Imaging optical system storing information on its aberration, imaging apparatus, and control method thereof

ABSTRACT

A focus adjustment device obtains a correction value for correcting a result of autofocus, from aberration information regarding at least one of an astigmatism, a chromatic aberration, and a spherical aberration of an imaging optical system, and focus detection information regarding the autofocus. The focus adjustment device then controls a position of a focusing lens that the imaging optical system has, based on a result of the autofocus corrected using the correction value. By correcting the result of the autofocus while considering at least a focus condition of a photographic image, a focus detection error caused by an aberration of the optical system can be accurately corrected.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of application Ser. No. 16/010,668,filed Jun. 18, 2018, which is a continuation of application Ser. No.14/699,665, filed Apr. 29, 2015, now U.S. Pat. No. 10,025,162, theentire disclosures of which is hereby incorporated by reference.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to a focus adjustment device, a method forcontrolling the focus adjustment device, and an image capture apparatus.

Description of the Related Art

As an autofocus (AF) method of an image capture apparatus, a contrast AFmethod and a phase-difference AF method are known. Both the contrast AFmethod and the phase-difference AF method are AF methods that are oftenused in video cameras and digital still cameras, and in some of these AFmethods, an image sensor is used as a focus detection sensor.

In these AF methods, focus detection is performed using an opticalimage, and accordingly there are cases where an aberration of an opticalsystem that forms the optical image causes an error in a focus detectionresult. A method for reducing this kind of error has been proposed.

Japanese Patent No. 5087077 (Document 1) discloses a method in whichreference correction data defining a combination of a plurality ofrepresentative values is prepared for each of an AF frame, a focallength, an AF evaluation frequency, and the distance to a subject, andcorrects a focus detection result using correction data obtained byperforming interpolation in accordance with an actual condition.

However, with the method in Document 1 that uses a correction valuesuitable for the AF evaluation frequency unique to a camera body tocorrect the focus detection result, a problem arises in that a focusdetection error cannot be sufficiently corrected. The focus detectionerror originally is a difference between a focus condition under whichan observer feels most favorable with respect to a photographic imageand a focus condition indicated by the focus detection result. However,in the method described in Document 1, the focus condition of thephotographic image is not considered. Furthermore, there are variousfactors in the focus detection error, and focus detection errorscorresponding to frequencies of respective factors are to be considered.However, this point is not considered in Document 1 either.

SUMMARY OF THE INVENTION

The present invention provides a focus adjustment device, a method forcontrolling the focus adjustment device, and an image capture apparatusthat can accurately correct a focus detection error caused by anaberration of an optical system, by correcting a focus detection resultwhile considering at least a focus condition of a photographic image,and that solve one or more problems in the conventional technique.

According to an aspect of the present invention, there is provided afocus adjustment device capable of executing autofocus by at least oneof a phase-difference detection method and a contrast detection method,the device comprising: an obtaining unit configured to obtain acorrection value for correcting a result of the autofocus, fromaberration information regarding at least one of an astigmatism, achromatic aberration, and a spherical aberration of an imaging opticalsystem, and focus detection information regarding the autofocus; and acontrol unit configured to control a position of a focusing lens thatthe imaging optical system has, based on the result of the autofocuscorrected using the correction value.

According to an aspect of the present invention, there is provided amethod for controlling a focus adjustment device capable of executingautofocus by at least one of a phase-difference detection method and acontrast detection method, the method comprising: an obtaining step ofobtaining a correction value for correcting a result of the autofocus,from aberration information regarding at least one of an astigmatism, achromatic aberration, and a spherical aberration of an imaging opticalsystem, and focus detection information regarding the autofocus; and acontrol step of controlling a position of a focusing lens that theimaging optical system has, based on the result of the autofocuscorrected using the correction value.

According to an aspect of the present invention, there is provided animage capture apparatus comprising: the focus adjustment deviceaccording to the present invention; a camera unit; and a lens unit thatincludes the imaging optical system and is detachable from the cameraunit, wherein the obtaining unit is provided in the camera unit.

According to an aspect of the present invention, there is provided animage capture apparatus comprising: the focus adjustment deviceaccording to the present invention; a camera unit; and a lens unit thatincludes the imaging optical system and is detachable from the cameraunit, wherein the obtaining unit is provided in the lens unit.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a flowchart showing an AF operation in an embodiment.

FIG. 1B is a flowchart showing the AF operation in an embodiment.

FIG. 2 is a block diagram of a digital camera serving as an exemplaryimage capture apparatus according to an embodiment.

FIGS. 3A and 3B are diagrams showing an exemplary configuration of animage sensor in an embodiment.

FIGS. 4A and 4B are diagrams showing a relationship between aphotoelectric conversion region and an exit pupil in an embodiment.

FIG. 5 is a block diagram of a TVAF unit 130 in FIG. 2 .

FIG. 6 is a diagram showing exemplary focus detection regions in anembodiment.

FIG. 7 is a flowchart of vertical/horizontal BP correction value (BP1)calculation processing in an embodiment.

FIGS. 8A and 8B are diagrams for illustrating vertical/horizontal BPcorrection value calculation processing in an embodiment.

FIGS. 9A to 9C are diagrams for illustrating color BP correction value(BP2) calculation processing in an embodiment.

FIGS. 10A to 10C are diagrams for illustrating spatial frequency BPcorrection value (BP3) calculation processing in a first embodiment.

FIGS. 11A to 11F are diagrams showing various spatial frequencycharacteristics in an embodiment.

FIG. 12 is a diagram for illustrating spatial frequency BP correctionvalue (BP3) calculation processing in a second embodiment.

FIG. 13 is a flowchart for illustrating spatial frequency BP correctionvalue (BP3) calculation processing in a third embodiment.

FIG. 14 is a flowchart showing an AF operation in a fourth embodiment.

FIG. 15 is a diagram for illustrating BP correction value (BP)calculation processing in the fourth embodiment.

FIGS. 16A to 16C are diagrams for illustrating the BP correction value(BP) calculation processing in the fourth embodiment.

FIG. 17 is a diagram for illustrating a modification of the BPcorrection value (BP) calculation processing in the fourth embodiment.

FIG. 18 is a diagram for illustrating BP correction value (BP)calculation processing in a fifth embodiment.

FIGS. 19A to 19C are diagrams for illustrating limit band processing inthe fifth embodiment.

DESCRIPTION OF THE EMBODIMENTS

Preferred embodiments of the present invention will now be described indetail in accordance with the accompanying drawings. Note that, althoughthe embodiments have specific configurations for the purpose offacilitating understanding and description of the present invention, thepresent invention is not limited to these specific configurations. Forexample, although a description will be given below of embodiments inwhich a focus adjustment device and a method for controlling the focusadjustment device according to the present invention are applied to animage capture apparatus, specifically a lens-interchangeable single-lensreflex digital camera, the present invention is also applicable to adigital camera whose lens is not interchangeable, and a video camera.The present invention can also be implemented in any electronic devicehaving a camera, e.g., a mobile phone, a personal computer (laptop,tablet, desktop PC, etc.), a game machine, and the like. Furthermore,the present invention can also be implemented in any device thatperforms focus adjustment of an optical system.

First Embodiment

Description of Configuration of Image Capture Apparatus—Lens Unit

FIG. 2 is a block diagram showing an exemplary configuration offunctions of a digital camera as an example of an image captureapparatus according to an embodiment. The digital camera in the presentembodiment is a lens-interchangeable single-lens reflex camera, and hasa lens unit 100 and a camera body 120. The lens unit 100 is mounted on acamera body 120 via a mount M denoted by a dotted line at the center ofFIG. 2 .

The lens unit 100 has an optical system (first lens group 101, diaphragm102, second lens group 103, and focusing lens group (hereinafterreferred to simply as “focusing lens”) 104) and a drive/control system.Thus, the lens unit 100 is an imaging lens that includes the focusinglens 104 and forms an optical image of a subject.

The first lens group 101 is arranged at a tip of the lens unit 100, andis held so as to be able to move in an optical axis direction OA. Thediaphragm 102 has a function of adjusting the amount of light at thetime of imaging, and also functions as a mechanical shutter forcontrolling exposure time when taking a still image. The diaphragm 102and the second lens group 103 can integrally move in the optical axisdirection OA, and achieve a zoom function by moving in conjunction withthe first lens group 101. The focusing lens 104 can also move in theoptical axis direction OA, and the subject distance (in-focus distanceor focused distance) at which the lens unit 100 focuses changes inaccordance with the position of the focusing lens 104. Focus adjustment,i.e., adjustment of the in-focus distance of the lens unit 100 isperformed by controlling the position of the focusing lens 104 in theoptical axis direction OA.

The drive/control system has a zoom actuator 111, a diaphragm actuator112, a focus actuator 113, a zoom drive circuit 114, a diaphragm drivecircuit 115, a focus drive circuit 116, a lens MPU 117, and a lensmemory 118.

The zoom drive circuit 114 drives the first lens group 101 and the thirdlens group 103 in the optical axis direction OA using the zoom actuator111, and controls the angle of view of the optical system of the lensunit 100. The diaphragm drive circuit 115 drives the diaphragm 102 usingthe diaphragm actuator 112, and controls the aperture and opening andclosing operations of the diaphragm 102. The focus drive circuit 116drives the focusing lens 104 in the optical axis direction OA using thefocus actuator 113, and controls the in-focus distance of the opticalsystem of the lens unit 100. The focus drive circuit 116 detects thecurrent position of the focusing lens 104 using the focus actuator 113.

The lens MPU (processor) 117 performs all calculation and controlrelating to the lens unit 100, and controls the zoom drive circuit 114,the diaphragm drive circuit 115, and the focus drive circuit 116. Thelens MPU 117 is connected to a camera MPU 125 through the mount M, andcommunicates commands and data therewith. For example, the lens MPU 117detects the position of the focusing lens 104, and notifies the cameraMPU 125 of lens position information in accordance with a request fromthe camera MPU 125. This lens position information contains informationsuch as a position of the focusing lens 104 in the optical axisdirection OA, the position in the optical axis direction OA and thediameter of an exit pupil in a state where the optical system is notmoving, and the position in the optical axis direction OA and thediameter of a lens frame that limits light beams of the exit pupil. Thelens MPU 117 also controls the zoom drive circuit 114, the diaphragmdrive circuit 115, and the focus drive circuit 116, in accordance with arequest from the camera MPU 125. Optical information necessary forautofocus is stored in advance in the lens memory 118. The camera MPU125 controls operations of the lens unit 100 by executing a programstored in a nonvolatile memory embedded in the camera MPU 125 or thelens memory 118.

Description of Configuration of Image Capture Apparatus—Camera Body

The camera body 120 has an optical system (optical low pass filter 121and image sensor 122) and a drive/control system. The first lens group101, the diaphragm 102, the second lens group 103, and the focusing lens104 in the lens unit 100, and the optical low pass filter 121 in thecamera body 120 constitute an imaging optical system.

The optical low pass filter 121 reduces false colors and moiré in aphotographic image. The image sensor 122 is constituted by a CMOS imagesensor and a peripheral circuit, and has m pixels arranged in thehorizontal direction and n pixels arranged in the vertical direction (nand m are integers that are 2 or larger). The image sensor 122 in thepresent embodiment has a pupil division function, and is capable of thephase-difference AF using image data. An image processing circuit 124generates, from image data output by the image sensor 122, data for thephase-difference AF and image data for display, recording, and thecontrast AF (TVAF).

The drive/control system has a sensor drive circuit 123, the imageprocessing circuit 124, the camera MPU 125, a display 126, an operationswitch group 127, a memory 128, a phase-difference AF unit 129, and aTVAF unit 130.

The sensor drive circuit 123 controls operations of the image sensor122, performs A/D conversion on an obtained image signal, and transmitsthe converted image signal to the camera MPU 125. The image processingcircuit 124 performs image processing that is generally performed in adigital camera, such as y conversion, white balancing processing, colorinterpolation processing, and compression coding processing, on theimage data obtained by the image sensor 122. The image processingcircuit 124 also generates a signal for the phase-difference AF.

The camera MPU (processor) 125 performs all calculation and controlrelating to the camera body 120, and controls the sensor drive circuit123, the image processing circuit 124, the display 126, the operationswitch group 127, the memory 128, the phase-difference AF unit 129, andthe TVAF unit 130. The camera MPU 125 is connected to the lens MPU 117via a signal line of the mount M, and communicates commands and datawith the lens MPU 117. The camera MPU 125 issues, to the lens MPU 117, arequest to obtain the lens position, a request to drive the diaphragm,the focusing lens, or zooming at a predetermined drive amount, a requestto obtain optical information unique to the lens unit 100, and the like.The camera MPU 125 incorporates a ROM 125 a that stores a program forcontrolling camera operations, a RAM 125 b that stores variables, and anEEPROM 125 c that stores various parameters.

The display 126 is constituted by an LCD or the like, and displaysinformation regarding imaging modes of the camera, a preview imagebefore imaging, an image for checking after imaging, an in-focus statedisplay image at the time of focus detection, and the like. Theoperation switch group 127 is constituted by a power switch, a release(imaging trigger) switch, a zoom operation switch, an imaging modeselection switch, and the like. The memory 128 is a removable flashmemory and records obtained images.

The phase-difference AF unit 129 performs focus detection processing bya phase-difference detection method, using data for focus detectionobtained by the image processing circuit 124. More specifically, theimage processing circuit 124 generates, as the data for focus detection,data of a pair of images formed by light beams passing through a pair ofpupil regions in the imaging optical system, and the phase-difference AFunit 129 detects a focus shift amount based on a shift amount in thedata of the pair of images. Thus, the phase-difference AF unit 129 inthe present embodiment performs the phase-difference AF (imaging planephase-difference AF) based on the output of the image sensor 122,without using a dedicated AF sensor. Operations of the phase-differenceAF unit 129 will be described later in detail.

The TVAF unit 130 performs focus detection processing by a contrastdetection method, based on an evaluation value for TVAF (contrastinformation of image data) generated by the image processing circuit124. In the focus detection processing by the contrast detection method,the focusing lens 104 is moved, and a focusing lens position at whichthe evaluation value reaches its peak is detected as an in-focusposition.

Thus, the digital camera in the present embodiment can execute both thephase-difference AF and the TVAF, and can selectively use them inaccordance with a situation, or can use them in combination.

Description of Focus Detection Operation: Phase-Difference AF

Operations of the phase-difference AF unit 129 and the TVAF unit 130will be further described below.

First, operations of the phase-difference AF unit 129 will be described.

FIG. 3A is a diagram showing a pixel array in the image sensor 122 inthe present embodiment, and shows a state of an area covering 6 (Ydirection) rows in the vertical direction and 8 (X direction) columns inthe horizontal directions of a two-dimensional C-MOS area sensor, asobserved from the lens unit 100 side. The image sensor 122 is providedwith a Bayer pattern color filter, where green (G) and red (R) colorfilters are alternately arranged in order from left on pixels in anodd-numbered row, and blue (B) and green (G) color filters arealternately arranged in order from left on pixels in an even-numberedrow. In a pixel 211, a circle 211 i represents an on-chip microlens, anda plurality of rectangles, namely rectangles 211 a and 211 b arrangedwithin the on-chip microlens are photoelectric conversion units.

In the image sensor 122 in the present embodiment, the photoelectricconversion unit in every pixel is divided into two portions in the Xdirection, and photoelectric conversion signals of individualphotoelectric conversion units and the sum of the photoelectricconversion signals can be independently read out. By subtracting thephotoelectric conversion signal of one of the photoelectric conversionunits from the sum of the photoelectric conversion signals, a signalcorresponding to the photoelectric conversion signal of the otherphotoelectric conversion unit can be obtained. The photoelectricconversion signals of the individual photoelectric conversion units canbe used as the data for the phase-difference AF, and for generating aparallax image that constitutes a 3D (3-Dimensional) image. The sum ofthe photoelectric conversion signals can be used as usual photographicimage data.

A pixel signal in the case of performing the phase-difference AF willnow be described. As described later, in the present embodiment, themicrolens 211 i and divided photoelectric conversion units 211 a and 211b in FIG. 3A perform pupil division on exit light beams of the imagingoptical system. Regarding a plurality of pixels 211 within apredetermined area arranged in the same pixel row, an image organized bycombining outputs of the photoelectric conversion units 211 a is set asan AF image A, and an image organized by combining outputs of thephotoelectric conversion units 211 b is set as an AF image B. Outputs ofthe photoelectric conversion units 211 a and 211 b use apseudo-luminance (Y) signal calculated by adding outputs of green, red,blue, and green that are included in a unit array of the color filter.However, the AF images A and B may be organized for each color of red,blue, and green. By detecting, using correlation calculation, a relativeimage shift amount between the AF images A and B generated as above, afocus shift amount (defocus amount) in a predetermined area can bedetected. In the present embodiment, the output of one of thephotoelectric conversion units in each pixel and the sum of the outputsof both photoelectric conversion units in the pixel are read out fromthe image sensor 122. For example, in the case of reading out the outputof the photoelectric conversion unit 211 a and the sum of the outputs ofthe photoelectric conversion units 211 a and 211 b, the output of thephotoelectric conversion unit 211 b is obtained by subtracting theoutput of the photoelectric conversion unit 211 a from the sum. Both theAF images A and B can thereby be obtained, achieving thephase-difference AF. Since this kind of image sensor is known asdisclosed in Japanese Patent Laid-Open No. 2004-134867, a furtherdescription of the details thereof will be omitted.

FIG. 3B is a diagram showing an exemplary configuration of a readoutcircuit of the image sensor 122 in the present embodiment. Referencenumeral 151 denotes a horizontal scanning circuit, and reference numeral153 denotes a vertical scanning circuit. Horizontal scan lines 152 a and152 b and vertical scan lines 154 a and 154 b are arranged at boundaryportions of each pixel, and a signal of each photoelectric conversionunit is read out to the outside via these scan lines.

Note that the image sensor in the present embodiment has the followingtwo kinds of readout mode in addition to the above-described method forreading out each pixel. A first readout mode is called an “all-pixelreadout mode”, which is a mode for capturing a fine still image. In thiscase, signals of all pixels are read out.

A second readout mode is called a “thinning readout mode”, which is amode for only recording a moving image or displaying a preview image.Since the necessary number of pixels in this case is smaller than thenumber of all pixels, only pixels in the pixel group that are left afterthe thinning at a predetermined ratio in both the X and Y directions areread out. The thinning readout mode is also used similarly in the casewhere high-speed readout is necessary. When thinning pixels in the Xdirection, signals are added to achieve an improvement in the S/N ratio,and when thinning pixels in the Y direction, signal outputs in thinnedrows are ignored. The phase-difference AF and the contrast AF are alsousually performed based on signals read out in the second readout mode.

FIGS. 4A and 4B are diagrams illustrating a conjugate relationshipbetween the exit pupil plane of the imaging optical system and thephotoelectric conversion units in the image sensor arranged at an imageheight of 0, i.e., near the center of an image surface in the imagecapture apparatus in the present embodiment. The photoelectricconversion units in the image sensor and the exit pupil plane of theimaging optical system are designed so as to have a conjugaterelationship through the on-chip microlens. In general, the exit pupilof the imaging optical system roughly coincides with a plane on which aniris diaphragm for adjusting the amount of light is placed. On the otherhand, the imaging optical system in the present embodiment is a zoomlens having a magnification changing function. Depending on the opticaltype, the distance of the exit pupil from the image surface or the sizeof the exit pupil changes when performing a magnification changingoperation. FIGS. 4A and 4B show a state where the focal length of thelens unit 100 is at the center between a wide-angle end and a telephotoend. Optimum design of the shape of the on-chip microlens and aneccentricity parameter suitable for the image height (X and Ycoordinates) is archived with the exit pupil distance Zep in this stateas a standard value.

In FIG. 4A, reference numeral 101 denotes the first lens group,reference numeral 101 b denotes a lens barrel member that holds thefirst lens group, reference numeral 105 denotes the third lens group,and reference numeral 104 b denotes a lens barrel member that holds thefocusing lens 104. Reference numeral 102 denotes the diaphragm,reference numeral 102 a denotes an aperture plate that defines theaperture when the diaphragm is opened, and reference numeral 102 bdenotes diaphragm blades for adjusting the aperture when the diaphragmis narrowed. Note that reference numerals 101 b, 102 a, 102 b, and 104b, which work as members for limiting light beams passing through theimaging optical system, denote an optical virtual image as observed fromthe image surface. A synthetic opening near the diaphragm 102 is definedas the exit pupil of the lens, and the distance thereof from the imagesurface is Zep, as mentioned above.

The pixel 211 is arranged near the center of the image surface, and willbe called a “center pixel” in the present embodiment. The center pixel211 is constituted, from the lowermost layer, the photoelectricconversion units 211 a and 211 b, interconnect layers 211 e to 211 g, acolor filter 211 h, and the on-chip microlens 211 i. The twophotoelectric conversion units are projected to the exit pupil plane ofthe imaging optical system by the on-chip microlens 211 i. In otherwords, the exit pupil of the imaging optical system is projected to asurface of the photoelectric conversion units via the on-chip microlens211 i.

FIG. 4B shows projected images of the photoelectric conversion units onthe exit pupil plane of the imaging optical system, and the projectedimages corresponding to the photoelectric conversion units 211 a and 211b are denoted respectively by EP1 a and EP1 b. In the presentembodiment, the image sensor has a pixel from which both an output ofone of the two photoelectric conversion units 211 a and 211 b and theoutput of the sum of the outputs of both photoelectric conversion unitscan be obtained. The output of the sum of the outputs from bothphotoelectric conversion units is obtained by performing photoelectricconversion on light beams that have passed through both areas of theprojected images EP1 a and EP1 b, which roughly cover the entire pupilregion of the imaging optical system.

In FIG. 4A, where sign L denotes outermost portions of the light beamspassing through the imaging optical system, the light beam L isrestricted by the aperture plate 102 a of the diaphragm, and vignettingis substantially not generated in the projected images EP1 a and EP1 bin the imaging optical system. In FIG. 4B, the light beam L in FIG. 4Ais denoted by TL. It can be found that vignetting is substantially notgenerated, also from the fact that most part of the projected images EP1a and EP1 b in the photoelectric conversion units is included within thecircle denoted by TL. Since the light beam L is limited only by theaperture plate 102 a of the diaphragm, TL can be replaced with 102 a. Atthis time, vignetting states of the projected images EP1 a and EP1 b aresymmetrical with respect to the optical axis at the image surfacecenter, and the amounts of light received by the photoelectricconversion units 211 a and 211 b are equal to each other.

In the case of performing the phase-difference AF, the camera MPU 125controls the sensor drive circuit 123 so as to read out theaforementioned two kinds of output from the image sensor 122. The cameraMPU 125 then gives the image processing circuit 124 information aboutthe focus detection region, and gives the image processing circuit 124an instruction to generate data of the AF images A and B from theoutputs of the pixels included in the focus detection region andsupplies the data to the phase-difference AF unit 129. The imageprocessing circuit 124 generates the data of the AF images A and B andoutputs the data to the phase-difference AF unit 129 in accordance withthe command. The image processing circuit 124 also supplies RAW imagedata to the TVAF unit 130.

As described above, the image sensor 122 constitutes a part of the focusdetection apparatus regarding both the phase-difference AF and thecontrast AF.

Note that, although an exemplary configuration has been described herein which the exit pupil is horizontally divided into two portions, somepixels in the image sensor may have a configuration in which the exitpupil is vertically divided into two portions. A configuration is alsopossible in which the exit pupil is divided both horizontallyvertically. As a result of providing a pixel in which the exit pupil isvertically divided, phase-difference AF is enabled that can handle boththe horizontal contrast and the vertical contrast of a subject.

(Description of Focus Detection Operation: Contrast AF)

Next, the contrast AF (TVAF) will be described using FIG. 5 . Thecontrast AF is achieved by the camera MPU 125 and the TVAF unit 130repeatedly performing the driving of the focusing lens and evaluationvalue calculation in conjunction with each other.

Upon the RAW image data being input from the image processing circuit124 to the TVAF unit 130, an AF evaluation signal processing circuit 401extracts a green (G) signal from Bayer pattern signals, and performsgamma correction processing for enhancing low luminance components andsuppressing high luminance components. Although the present embodimentwill describe a case of performing the TVAF using a green (G) signal,all signals of red (R), blue (B), and green (G) may be used. A luminance(Y) signal may be generated using all RGB colors. In the followingdescription, an output signal generated by the AF evaluation signalprocessing circuit 401 will be called a “luminance signal Y” regardlessof the type of a signal to be used.

Note that it is assumed that the focus detection region is set in aregion setting circuit 413 by the camera MPU 125. The region settingcircuit 413 generates a gate signal for selecting a signal within theset region. The gate signal is input to a line peak detection circuit402, a horizontal integration circuit 403, a line minimum valuedetection circuit 404, a line peak detection circuit 409, verticalintegration circuits 406 and 410, and vertical peak detection circuits405, 407, and 411. Also, a timing of the luminance signal Y being inputto each circuit is controlled such that each focus evaluation value isgenerated with the luminance signal Y within the focus detection region.Note that a plurality of regions can be set in the region settingcircuit 413 in accordance with the focus detection region.

A method for calculating a Y peak evaluation value will now bedescribed. The luminance signal Y that has been subjected to gammacorrection is input to the line peak detection circuit 402, and a Y linepeak value of each horizontal line is obtained within the focusdetection region that is set in the region setting circuit 413. A peakof the output of the line peak detection circuit 402 is held in thevertical direction within the focus detection region by the verticalpeak detection circuit 405, and a Y peak evaluation value is generated.The Y peak evaluation value is an index that is effective indetermination of a high-luminance subject and a low-luminance subject.

A method for calculating a Y integral evaluation value will now bedescribed. The luminance signal Y that has been subjected to gammacorrection is input to the horizontal integration circuit 403, and a Yintegral value is obtained in each horizontal line within the focusdetection region. Furthermore, the output of the horizontal integrationcircuit 403 is integrated in the vertical direction within the focusdetection region by the vertical integration circuit 406, and a Yintegral evaluation value is generated. The Y integral evaluation valuecan be used as an index for determining the brightness of the entirefocus detection region.

A method for calculating a Max-Min evaluation value will be described.The luminance signal Y that has been subjected to gamma correction isinput to the line peak detection circuit 402, and a Y line peak value ofeach horizontal line is obtained within the focus detection region. Theluminance signal Y that has been subjected to gamma correction is alsoinput to the line minimum value detection circuit 404, and a minimumvalue of Y is detected in each horizontal line within the focusdetection region. The detected line peak value and smallest value of Yin each horizontal line are input to a subtracter, and (line peakvalue-minimum value) is input to the vertical peak detection circuit407. The vertical peak detection circuit 407 holds the peak in thevertical direction within the focus detection region, and generates aMax-Min evaluation value. The Max-Min evaluation value is an index thatis effective for determination of low contrast and high contrast.

A method for calculating a region peak evaluation value will now bedescribed. By passing the luminance signal Y that has been subjected togamma correction through a BPF 408, specific frequency components areextracted and a focus signal is generated. This focus signal is input tothe line peak detection circuit 409, and a line peak value in eachhorizontal line is obtained within the focus detection region. The linepeak value is held as a peak in the focus detection region by thevertical peak detection circuit 411, and a region peak evaluation valueis generated. The region peak evaluation value varies only a little evenif a subject moves within the focus detection region, and accordingly isan index that is effective for restart determination, i.e.,determination of whether to transition to processing for finding anin-focus point again from an in-focus state.

A method for calculating an all-line integral evaluation value will nowbe described. As with the region peak evaluation value, the line peakdetection circuit 409 obtains a line peak value in each horizontal linewithin the focus detection region. Next, the line peak detection circuit409 inputs the line peak value to the vertical integration circuit 410,and integrates, in the vertical direction, the line peak value withrespect to the number of all horizontal scan lines within the focusdetection region to generate an all-line integral evaluation value. Ahigh-frequency all-line integral evaluation value, which has a widedynamic range and a high sensitivity due to the effect of integration,is a main AF evaluation value. Accordingly, in the present embodiment,when a “focus evaluation value” is simply recited, it means the all-lineintegral evaluation value.

The AF control unit 151 in the camera MPU 125 obtains the aforementionedrespective focus evaluation values, and moves the focusing lens 104 in apredetermined direction along the optical axis direction by apredetermined amount through the lens MPU 117. The AF control unit 151then calculates the aforementioned various evaluation values based on anewly obtained image data, and detects a focusing lens position at whichthe all-line integral evaluation value is largest.

In the present embodiment, various AF evaluation values are calculatedin the horizontal line direction and the vertical line direction. Focusdetection can thereby be performed with respect to subject contrastinformation in two perpendicular directions, namely the horizontal andvertical directions.

(Description of Focus Detection Region)

FIG. 6 is a diagram showing exemplary focus detection regions within animaging area. As mentioned above, both the phase-difference AF and thecontrast AF are performed based on signals obtained from the pixelsincluded in the focus detection regions. In FIG. 6 , a large rectangledenoted by dotted lines is an imaging area 217 in which the pixels ofthe image sensor 122 are formed. In the imaging area 217, focusdetection regions 218 ah, 218 bh, and 218 ch for the phase-difference AFare set. In the present embodiment, the focus detection regions 218 ah,218 bh, and 218 ch for the phase-difference AF are set at threeportions, which are a center portion of the imaging area 217 and twoportions respectively on the left and right sides thereof. Also, focusdetection regions 219 a, 219 b, and 219 c for the TVAF are set so as torespectively surround focus detection regions 218 ah, 218 bh, and 218 chfor the phase-difference AF. Note that FIG. 6 shows an exemplary settingof the focus detection regions, and the number, position, and size ofthe focus detection regions are not limited to those shown in FIG. 6 .

(Description of Focus Detection Processing Flow)

Next, an autofocus (AF) operation in the digital camera in the presentembodiment will be described with reference to FIGS. 1A and 1B.

A description of an outline of AF processing will be given first, andthereafter a detailed description will be given. In the presentembodiment, the camera MPU 125 initially applies the phase-difference AFto the focus detection regions 218 ah, 218 bh, and 218 ch to obtain afocus shift amount (defocus amount) of each focus detection region and areliability of the defocus amount. If a defocus amount having apredetermined reliability is obtained in all of the focus detectionregions 218 ah, 218 bh, and 218 ch, the camera MPU 125 moves thefocusing lens 104 to an in-focus position of a closest subject, based onthe defocus amount.

On the other hand, if a defocus amount having the predeterminedreliability is not obtained from any of the focus detection regions, thecamera MPU 125 obtains a focus evaluation value with respect to a focusdetection region for the contrast AF that includes the focus detectionregion from which the defocus amount having the predeterminedreliability is not obtained. The camera MPU 125 determines whether asubject exists on a closer side with respect to the subject distancecorresponding to the defocus amount obtained by the phase-difference AF,based on a relationship between a change of the focus evaluation valueand the position of the focusing lens 104. If it is determined that asubject exists on the closer side, the camera MPU 125 drives thefocusing lens 104 in a direction based on the change of the focusevaluation value.

Note that, if the focus evaluation value has not been obtained before,the amount of change of the focus evaluation value cannot be obtained.In this case, if a focus detection region exists from which a defocusamount that is larger than a predetermined defocus amount and has thepredetermined reliability has been obtained, the camera MPU 125 drivesthe focusing lens 104 so as to focus on a closest subject in this focusdetection region. If a defocus amount having the predeterminedreliability has not been obtained, and if a defocus amount larger thanthe predetermined defocus amount has not been obtained, the camera MPU125 drives the focusing lens 104 by a predetermined amount which doesnot relate to the defocus amount. This is because, if the focusing lens104 is driven based on a small defocus amount, it is highly likely thatthe change of the focus evaluation value is difficult to detect at thetime of next focus detection.

Upon ending focus detection by any of the methods, the camera MPU 125calculates the various correction values and corrects a focus detectionresult. The camera MPU 125 then drives the focusing lens 104 based onthe focus detection result after the correction.

The details of the above-described AF processing will be described belowusing flowcharts shown in FIGS. 1A and 1B. The following AF processingoperations are executed mainly by the camera MPU 125, except when it isclearly stated that other member performs the operation. When the cameraMPU 125 drives or controls the lens unit 100 by transmitting a commandor the like to the lens MPU 117, there are cases where it is stated thatthe camera MPU 125 performs the operation, for the sake ofsimplification of the description.

In step S1, the camera MPU 125 sets the focus detection regions. It isassumed here that three focus detection regions such as those shown inFIG. 6 are set for the phase-difference AF and the contrast AF.

In step S2, the camera MPU 125 sets a determination flag within the RAM125 b to 1.

In step S3, the camera MPU 125 exposes the image sensor 122, reads outimage signals, and causes the image processing circuit 124 to generateimage signals for the phase-difference AF based on image data within thefocus detection regions 218 ah, 218 bh, and 218 ch for thephase-difference AF. The camera MPU 125 also causes the image processingcircuit 124 to supply RAW image data generated by the image processingcircuit 124 to the TVAF unit 130, and causes the TVAF unit 130 tocalculate the evaluation values based on the pixel data within the focusdetection regions 219 a, 219 b, and 219 c for the TVAF. Note that,before generating the image signals for the phase-difference AF,processing (see Japanese Patent Laid-Open No. 2010-117679) forcorrecting asymmetry of the exit pupil caused by vignetting of lightbeams due to the lens frame of photographic lenses or the like may beapplied in the image processing circuit 124. The focus evaluation valuecalculated by the TVAF unit 130 is stored in the RAM 125 b in the cameraMPU 125.

In step S4, the camera MPU 125 determines whether or not a reliable peak(local maximum value) of the focus evaluation value has been detected.If a reliable peak has been detected, the camera MPU 125 advances theprocessing to step S20 in order to end the focus detection processing.Note that, although the method for calculating the reliability of thepeak of the focus evaluation value is not limited, for example, a methoddescribed using FIGS. 10A to 13 in Japanese Patent Laid-Open No.2010-78810 is available. Specifically, it is determined whether or not adetected peak indicates an apex of a curve, by comparing, withrespective threshold values, a difference between the largest value andthe smallest value of the focus evaluation value, a length of a portioninclining at an inclination larger than or equal to a fixed value(SlopeThr), and a slope of the inclining portion. If all thresholdconditions are satisfied, it can be determined that the peak isreliable.

In the present embodiment, both the phase-difference AF and the contrastAF are used. For this reason, if it has been confirmed that a subject onthe closer side exists in the same focus detection region or other focusdetection regions, the processing may be advanced to step S5 withoutending focus detection even if a reliable focus evaluation value peak isdetected. However, in this case, the position of the focusing lens 104corresponding to the reliable focus evaluation value peak is stored, andthe stored position of the focusing lens 104 is used as the focusdetection result if a reliable focus detection result is not obtained inthe processing in step S5 and subsequent steps.

In step S5, the phase-difference AF unit 129 calculates a shift amount(phase difference) between a pair of image signals supplied from theimage processing circuit 124, for each of the focus detection regions218 ch, 218 ah, and 218 bh, and converts the phase difference into adefocus amount using a conversion coefficient that is stored in advance.Here, determination is also performed on the reliability of thecalculated defocus amount, and only the defocus amount of the focusdetection region that is determined to have the predeterminedreliability is used in subsequent AF processing. The phase differencedetected between the pair of image signals contains more errors as thedefocus amount is larger, due to the influence of vignetting caused bythe lens frame or the like. For this reason, it can be determined thatthe obtained defocus amount does not have the predetermined reliability(i.e., has a low reliability) in the case where the obtained defocusamount is larger than the threshold value, where the degree ofcoincidence between the shapes of the pair of image signals is low, orwhere the contrast of the image signals is low. The case where it isdetermined that the obtained defocus amount has the predeterminedreliability will be expressed below as “the defocus amount can becalculated”. The case where the defocus amount cannot be calculated forsome reason and the case where it is determined that the reliability ofthe defocus amount is low will be expressed as “the defocus amountcannot be calculated”.

In step S6, the camera MPU 125 checks whether or not the defocus amountcan be calculated in all of the focus detection regions 218 ah, 218 bh,and 218 ch for the phase-difference AF that are set in step S1. If thedefocus amount can be calculated in all focus detection regions, thecamera MPU 125 advances the processing to step S20, and calculates avertical/horizontal BP correction value (BP1) with respect to a focusdetection region in which a defocus amount indicating a subject existingon the closest side is calculated, among the calculated defocus amounts.Here, the reason for selecting the subject on the closest side isbecause, in general, a subject that a photographer wants to focus onoften exists on the closer side. The vertical/horizontal BP correctionvalue (BP1) is a value for correcting a difference in the focusdetection result in the case of performing focus detection with respectto horizontal contrast of a subject and the focus detection result inthe case of performing focus detection with respect to vertical contrastof a subject.

A general subject has contrast in both the horizontal and verticaldirections, and a focus condition of a photographic image is alsoevaluated while considering the contrast in both the horizontal andvertical directions. On the other hand, when performing the focusdetection only in the horizontal direction as in the above-described AFby the phase-difference detection method, an error occurs between ahorizontal focus detection result and a focus condition in both thehorizontal and vertical directions of a photographic image. This erroroccurs due to astigmatism or the like in the imaging optical system. Thevertical/horizontal BP correction value (BP1) is a correction value forcorrecting this error, and is calculated while considering the selectedfocus detection region, the position of the focusing lens 104, theposition of the first lens group 101 indicating a zoom state, and thelike. The details of the calculation method will be described later.

In step S21, the camera MPU 125 calculates a color BP correction value(BP2) with respect to the focus detection region that is a target of thecorrection value calculation in step S20, using vertical or horizontalcontrast information. The color BP correction value (BP2) is generatedby a chromatic aberration in the imaging optical system, and isgenerated due to a difference between color balance of a signal used infocus detection and color balance of a signal used in a photographicimage or a developed image. For example, in the contrast AF in thepresent embodiment, the focus evaluation value is generated based on theoutput of a pixel (green pixel) having a green (G) color filter, andtherefore an in-focus position of a wavelength of green is mainlydetected. However, since the photographic image is generated using allRGB colors, if the in-focus position of red (R) or blue (B) is differentfrom that of green (G) (i.e., an axial chromatic aberration exists), ashift (error) from the focus detection result based on the focusevaluation value occurs. The correction value for correcting this erroris the color BP correction value (BP2). The details of the method forcalculating the color BP correction value (BP2) will be described later.

In step S22, the camera MPU 125 calculates a specific spatial frequencyBP correction value (BP3) with respect to the correction target focusdetection region using contrast information of a green signal or theluminance signal Y in the vertical or horizontal direction. The spatialfrequency BP correction value (BP3) is generated mainly due to aspherical aberration in the imaging optical system, and is generated dueto a difference between an evaluation frequency (band) of a signal usedin focus detection and an evaluation frequency (band) at the time ofappreciating a photographic image. Since the image signals at the timeof focus detection are read out from the image sensor in the second modeas mentioned above, the output signals have been subjected to theaddition and the thinning. For this reason, the output signal used infocus detection has a lower evaluation band as compared with aphotographic image generated using signals of all pixels that are readout in the first readout mode. The spatial frequency BP correction value(BP3) is for correcting a shift in focus detection generated due to thedifference in the evaluation band. The details of the method forcalculating the spatial frequency BP correction value (BP3) will bedescribed later.

In step S23, the camera MPU 125 corrects a focus detection result DEF_Bin accordance with Equation (1) below using the three calculatedcorrection values (BP1, BP2, BP3), and calculates a focus detectionresult DEF_A after the correction.DEF_A=DEF_B+BP1+BP2+BP3  (1)

In the present embodiment, the correction values for correcting thefocus detection result are calculated in three steps in the order of“vertical/horizontal” (S20), “color” (S21), and “spatial frequency”(S22).

Initially, an error caused by using contrast information in onedirection in focus detection whereas contrast information in both thevertical and horizontal directions is used in evaluation at the time ofappreciating a photographic image is calculated as thevertical/horizontal BP correction value (BP1).

Next, the influence of the vertical/horizontal BP is separated, and adifference in the in-focus position between the color of the signal usedin the photographic image and the color of the signal used at the timeof focus detection in contrast information in one direction iscalculated as the color BP correction value (BP2).

Furthermore, in the contrast information in one direction, a differencein the in-focus position generated due to a difference in the evaluationband of a green color or a specific color of the luminance signal or thelike between at the time of appreciating a photographic image and at thetime of focus detection is calculated as the spatial frequency BPcorrection value (BP3).

Thus, a reduction in the amount of calculation and a reduction in thevolume of data to be stored in the lens or the camera are achieved byseparately calculating three kinds of errors.

In step S24, the camera MPU 125 drives the focusing lens 104 through thelens MPU 117, based on the defocus amount DEF_A after the correctioncalculated using Equation (1).

In step S25, the camera MPU 125 provides a display (AF frame display)indicating the focus detection region in which the defocus amount usedin the driving of the focusing lens 104 is calculated, so as to besuperimposed on a live view image, for example, on the display 126, andends the AF processing.

On the other hand, if a focus detection region exists in which thedefocus amount cannot be calculated in step S6, the camera MPU 125advances the processing to step S7 in FIG. 1B. In step S7, the cameraMPU 125 determines whether or not the determination flag is 1. Thedetermination flag is 1 when the driving of the focusing lens has notbeen performed even once since the AF operation started. If the drivingof the focusing lens has ever been performed, the determination flag is0. If the determination flag is 1, the camera MPU 125 advances theprocessing to step S8.

If, in step S8, the camera MPU 125 cannot calculate the defocus amountin any of the focus detection regions, or if the defocus amountindicating the presence of a subject on the closest side among thecalculated defocus amounts is smaller than or equal to a predeterminedthreshold value A, the camera MPU 125 advances the processing to stepS9. In step S9, the camera MPU 125 drives the focusing lens toward thecloser side by a predetermined amount.

Here, a description will be given of the reason for driving the lens bya predetermined amount if the result of step S8 is Yes. First, the casewhere the defocus amount cannot be calculated in any region among theplurality of focus detection regions is the case where a subject onwhich focusing is to be performed has not been found at this moment. Forthis reason, before determining that focusing cannot be performed, thelens is driven by the predetermined amount with respect to all focusdetection regions, in order to check the presence of a subject on whichfocusing is to be performed, such that a later-described change of thefocus evaluation value can be determined. Also, the case where thedefocus amount indicating the presence of a subject on the closest sideamong the calculated defocus amounts is smaller than or equal to thepredetermined threshold value A is the case where the focus detectionregion that is almost in an in-focus state exists at this moment. Inthis situation, the lens is driven by the predetermined amount in orderto check the possibility that a subject which has not been detected atthis moment exists further on the closer side in the focus detectionregion in which the defocus amount cannot be calculated, such that thelater-described change of the focus evaluation value can be determined.

Note that the predetermined amount by which the focusing lens is drivenin step S9 may be determined by considering the sensitivity of theamount of focus movement on the imaging plane with respect to the Fvalue or the lens drive amount of the imaging optical system.

On the other hand, if the result in step S8 is No, i.e., if the defocusamount indicating the presence of a subject on the closest side amongthe calculated defocus amounts is larger than the predeterminedthreshold value A, the processing proceeds to step S10. In this case, afocus detection region in which the defocus amount can be calculatedexists, but this focus detection region is not in an in-focus state. Forthis reason, in step S10, the camera MPU 125 drives the lens based onthe defocus amount indicating the presence of the subject on the closestside among the calculated defocus amounts.

After driving the lens in step S9 or S10, the camera MPU 125 advancesthe processing to step S11, sets the determination flag to 0, andreturns the processing to step S3 in FIG. 1A.

If, in step S7, the determination flag is not 1 (i.e., the determinationflag is 0), the camera MPU 125 advances the processing to step S12. Instep S12, the camera MPU 125 determines whether or not the focusevaluation value in the focus detection region for the TVAFcorresponding to the focus detection region in which the defocus amountcannot be calculated has changed by a predetermined threshold value B orlarger before and after the driving of the lens. Although the focusevaluation value increases in some cases and decreases in other cases,it is determined in step S12 whether or not the absolute value of theamount of change of the focus evaluation value is larger than or equalto the predetermined threshold value B.

Here, the case where the absolute value of the amount of change of thefocus evaluation value is larger than or equal to the predeterminedthreshold value B means that, although the defocus amount cannot becalculated, a change of a blurred state of a subject can be detectedbased on an increase or decrease of the focus evaluation value. For thisreason, in the present embodiment, even in the case where the defocusamount cannot be detected by the phase-difference AF, the presence of asubject is determined based on an increase or decrease of the focusevaluation value, and the AF processing is continued. Focus adjustmentcan thereby be performed on a subject that has a large defocus amountand cannot be detected by the phase-difference AF.

Here, the predetermined threshold value B used in the determination ischanged in accordance with the lens drive amount. If the lens driveamount is large, a larger value is set as the threshold value B thanthat in the case of a small lens drive amount. This is because, if asubject exists, the amount of change of the focus evaluation valueincreases in accordance with an increase of the lens drive amount. Thethreshold values B for the respective lens drive amounts are stored inthe EEPROM 125 c.

If the absolute value of the amount of change of the focus evaluationvalue is larger than or equal to the threshold value B, the camera MPU125 advances the processing to step S13, and determines whether or notthe focus detection region whose amount of change of the focusevaluation value is larger than or equal to the threshold value B isonly the focus detection region indicating the presence of a subject onan infinite side. The case where the focus detection region indicatesthe presence of a subject on the infinite side is the case where thefocus evaluation value decreases when the driving direction of the lensdriving is a closer direction, or the case where the focus evaluationvalue increases when the driving direction of the lens driving is aninfinite direction.

If the focus detection region whose amount of change of the focusevaluation value is larger than or equal to the threshold value B is notonly the focus detection region indicating the presence of the subjecton the infinite side, the camera MPU 125 advances the processing to stepS14, and drives the lens toward the closer side by a predeterminedamount. This is because the focus detection region indicating thepresence of a subject on the closer side is included in the focusdetection region whose amount of change of the focus evaluation value islarger than or equal to the threshold value B. Note that the reason forgiving priority to a subject on the closer side is as mentioned above.

On the other hand, if, in step S13, the focus detection region whoseamount of change of the focus evaluation value is larger than or equalto the threshold value B is only the focus detection region indicatingthe presence of a subject on the infinite side, the camera MPU 125advances the processing to step S15. In step S15, the camera MPU 125determines whether or not a focus detection region in which the defocusamount can be calculated exists. In the case where a focus detectionregion in which the defocus amount can be calculated exists (Yes inS15), the result of the phase-difference AF is given priority to thepresence of the subject on the infinite side based on the focusevaluation value, and accordingly the camera MPU 125 advances theprocessing to step S20 in FIG. 1A.

If a focus detection region in which the defocus amount can becalculated does not exist (No in S15), the information indicating thepresence of a subject is only the change of the focus evaluation value.For this reason, in step S16, the camera MPU 125 drives the lens towardthe infinite side by a predetermined amount based on the change of thefocus evaluation value, and returns the processing to step S3 in FIG.1A.

The predetermined amount by which the lens is driven in steps S14 andS16 may be determined by considering the defocus amount that can bedetected by the phase-difference AF. Although the detectable defocusamount is different depending on the subject, a lens drive amount is setin advance so as to prevent a situation where a subject cannot bedetected and is passed through when driving the lens from a state wherefocus detection cannot be performed.

If the absolute value of the amount of change of the focus evaluationvalue is smaller than the predetermined threshold value B (No in S12),the camera MPU 125 advances the processing to step S17, and determineswhether or not the focus detection region exists in which the defocusamount can be calculated exists. If the defocus amount cannot becalculated in any of the focus detection regions, the camera MPU 125advances the processing to step S18, drives the lens to a predeterminedfixed point, thereafter further advances the processing to step S19,performs display indicating a no-focus state on the display 126, andends the AF processing. This is the case where there is no focusdetection region in which the defocus amount can be calculated, andthere is no focus detection region whose focus evaluation value haschanged before and after the lens driving. In this case, since noinformation indicates the presence of a subject, the camera MPU 125determines that focusing cannot be performed, and ends the AFprocessing.

On the other hand, if, in step S17, a focus detection region in whichthe defocus amount can be calculated exists, the camera MPU 125 advancesthe processing to step S20 in FIG. 1A, corrects the detected defocusamount (S20 to S23), and drives the focusing lens 104 to the in-focusposition in step S24. Thereafter, in step S25, the camera MPU 125performs display indicating an in-focus state on the display 126, andends the AF processing.

Method for Calculating Vertical/Horizontal BP Correction Value

Next, a description will be given, using FIGS. 7 to 8B, of a method ofcalculating the vertical/horizontal BP correction value (BP1)calculation in step S20 in FIG. 1A. FIG. 7 is a flowchart showing thedetails of the vertical/horizontal BP correction value (BP1) calculationprocessing.

In step S100, the camera MPU 125 obtains vertical/horizontal BPcorrection information. The vertical/horizontal BP correctioninformation is information of a difference between an in-focus positionin the horizontal direction (first direction) and an in-focus positionin the vertical direction (second direction). In the present embodiment,the vertical/horizontal BP correction information is stored in advancein the lens memory 118 in the lens unit 100, and the camera MPU 125obtains the vertical/horizontal BP correction information by requestingit from the lens MPU 117. However, the vertical/horizontal BP correctioninformation may be stored in association with identification informationof the lens unit in a nonvolatile area of the camera RAM 125 b.

FIG. 8A shows exemplary vertical/horizontal BP correction information.Although an example of the vertical/horizontal BP correction informationcorresponding to the center focus detection regions 219 a and 218 ah inFIG. 6 is shown here, the vertical/horizontal BP correction informationcorresponding to the other focus detection regions 219 c, 218 ch, 219 b,and 218 bh is also stored. However, the focus detection correctionvalues of focus detection regions existing at symmetrical positions withrespect to the optical axis of the imaging optical system are equal toeach other in design. Since the focus detection regions 219 c and 218 chand the focus detection regions 219 b and 218 bh respectively satisfythis asymmetrical relationship in the present embodiment, thevertical/horizontal BP correction information of one of the focusdetection region in each pair may be stored. Also, if the correctionvalue does not significantly change depending on the position of thefocus detection region, the correction value may be stored as a commonvalue.

In the example shown in FIG. 8A, each of a zoom position (angle of view)and a focusing lens position (in-focus distance) in the imaging opticalsystem is divided into 8 zones, and the focus detection correctionvalues BP111 to BP188 are stored for respective zones. As the number ofdivided zones is larger, a more accurate correction value suitable forthe position of the first lens group 101 and the position of thefocusing lens 104 in the imaging optical system can be obtained. Also,the vertical/horizontal BP correction information can be used in boththe contrast AF and the phase-difference AF.

In step S100, the camera MPU 125 obtains the correction valuecorresponding to the zoom position and the focusing lens positionsuitable for a correction target focus detection result.

In step S101, the camera MPU 125 determines whether reliable focusdetection results have been obtained with respect to both the horizontaland vertical directions in the correction target focus detection region.The method for determining the reliability of the focus detection resultis as described above regarding both the phase-difference AF and thecontrast AF. Since only horizontal focus detection is performed in thephase-difference AF in the present embodiment, reliable focus detectionresults with respect to both the horizontal and vertical directions areobtained by the contrast AF. For this reason, the following descriptionregarding the vertical/horizontal BP correction value assumes thecontrast AF, whereas similar processing may be performed also in thecase of performing focus detection by the phase-difference AF in boththe horizontal and vertical directions. If it is determined in step S101that both the horizontal and vertical focus detection results arereliable, the camera MPU 125 advances the processing to step S102.

In step S102, the camera MPU 125 determines whether or not a differencebetween the horizontal focus detection result and the vertical focusdetection result is appropriate. This is processing performed in orderto handle a problem of a shifting of focus between far and closesubjects, which occurs when subjects at a far distance and at a closedistance are included in the focus detection region. For example, if thefar subject has horizontal contrast and the close subject has verticalcontrast, there are cases where the absolute value is larger than anerror that is caused by astigmatism in the imaging optical system, orwhere the focus detection results have opposite signs. If the differencebetween the horizontal focus detection result and the vertical focusdetection result is larger than a predetermined determination value C,the camera MPU 125 determines that the difference is not appropriate(i.e., a shifting of focus has occurred). The camera MPU 125 thenselects the horizontal direction or the vertical direction as adirection indicating the focus detection result that is further on thecloser side, and advances the processing to step S104. Note that, forthe above reason, the determination value C may be uniquely determinedto be a value that significantly exceeds a possible difference caused byan aberration or the like, or may be set using the correctioninformation obtained in step S100.

If it is determined in step S102 that the difference between thehorizontal focus detection result and the vertical focus detectionresult is appropriate, the camera MPU 125 advances the processing tostep S106.

On the other hand, if, in step S101, only the focus detection result ineither the horizontal direction or the vertical direction is reliable,or if, in step S102, only one of the horizontal direction and thevertical direction is selected, the camera MPU 125 advances theprocessing to step S104. In step S104, the camera MPU 125 selects thedirection of the focus detection result. The camera MPU 125 selects thedirection in which the reliable focus detection result is calculated, orthe direction in which the focus detection result corresponding to asubject that is further on the closer side is calculated in thedetermination regarding a shifting of focus.

Next, in step S105, the camera MPU 125 determines whether or notweighting in the horizontal direction and the vertical direction can beperformed. When step S105 is executed, from the viewpoint of thereliability of the focus evaluation value and a shifting of focus,determination for calculating the vertical/horizontal BP correctionvalue is performed again even though reliable focus detection resultshave not been obtained in both the horizontal and vertical directions.The reason thereof will now be described in detail using FIG. 8B.

FIG. 8B is a diagram showing an exemplary relationship between theposition of the focusing lens 104 in the selected focus detection regionand the focus evaluation values. Curves E_h and E_v in FIG. 8B denotechanges of the horizontal focus evaluation value and the vertical focusevaluation value that are detected by the contrast AF. Signs LP1, LP2,and LP3 denote focusing lens positions. FIG. 8B shows the case where LP3is obtained as a reliable focus detection result from the horizontalfocus evaluation value E_h, and LP1 is obtained as a reliable focusdetection result from the vertical focus evaluation value E_v. It isdetermined that a shifting of focus has occurred since LP1 and LP3 aresignificantly different, and the horizontal focus detection result LP3,which is the focus detection result that is further on the closer side,is selected in step S104.

In this situation, in step S105, the camera MPU 125 determines whetheror not a vertical focus detection exists near the selected horizontalfocus detection result LP3. Since LP2 exists in the situation in FIG.8B, the camera MPU 125 determines that weighting in the horizontal andvertical directions can be performed, advances the processing to stepS106, and calculates the correction value for the focus detection resultLP3 while considering the influence of the focus detection result LP2.

Assume that BP1_B, which is one element in FIG. 8A, has been obtained asthe vertical/horizontal BP correction information in step S100, thehorizontal focus evaluation value at LP3 in FIG. 8B is E_hp, and thevertical focus evaluation value at LP2 is E_vp. In this case, in stepS106, the camera MPU 125 calculates the vertical/horizontal BPcorrection value BP1 in accordance with Equation (2) below, based on theratio of the focus evaluation value in a direction perpendicular to thedirection subjected to the correction to the total of the focusevaluation values.BP1=BP1_B×E_vp/(E_vp+E_hp)×(+1)  (2)

Although the correction value BP1 is calculated using Equation (2) sincethe correction value for the horizontal focus detection result iscalculated in the present embodiment, the calculation can be performedusing Equation (3) below when correcting the vertical focus detectionresult.BP1=BP1_B×E_hp/(E_vp+E_hp)×(−1)  (3)

If it is determined in step S102 that the difference between thehorizontal focus detection result and the vertical focus detectionresult is appropriate, the correction value BP1 is calculated usingEquation (2) in the case where the focus detection result on the closerside is the horizontal detection result, or using Equation (3) in thecase of the vertical detection result.

As is clear from Equations (2) and (3), the vertical/horizontal BPcorrection value (BP1) is calculated while determining that a subjectcontains a large amount of contrast information, based on theinformation indicating that the focus evaluation value is large. Asdescribed above, the vertical/horizontal BP correction information is:

(focus detection position of subject having contrast information only invertical direction)-(focus detection position of subject having contrastinformation only in horizontal direction). For this reason, thecorrection value BP1 for correcting the horizontal focus detectionresult and the correction value BP1 for correcting the vertical focusdetection result have opposite signs. Upon ending the processing in stepS106, the camera MPU 125 ends the vertical/horizontal BP correctionvalue calculation processing.

On the other hand, if it is determined in step S105 that a verticalfocus detection result does not exist near the selected horizontal focusdetection result LP3, the camera MPU 125 advances the processing to stepS103. In step S103, the camera MPU 125 determines that the subjectcontains the contrast information substantially only in one direction,and accordingly BP1=0 is set, and the vertical/horizontal BP correctionvalue calculation processing ends.

Thus, in the present embodiment, the correction value is calculated inaccordance with the contrast information of a subject in differentdirections, and therefore the correction value can be accuratelycalculated in accordance with the pattern of the subject. Note that,although the case where a shifting of focus has occurred betweensubjects has been described in FIG. 8B, the correction value is alsocalculated based on a similar idea when one local maximum value isdetected in each of the horizontal and vertical directions, and one ofthe focus detection results is not reliable.

However, the correction value calculation method in step S106 is notlimited thereto. For example, if focus detection can be performed onlyin the horizontal direction as in the phase-difference AF in the presentembodiment, the correction value may be calculated while assuming thatthe amount of the contrast information of the subject in the horizontaldirection is the same as that in the vertical direction. In this case,the correction value can be calculated by substituting E_hp=E_vp=1 intoEquation (2) or (3) above. By performing this processing, the correctionaccuracy lowers, but the load of the correction value calculation can bereduced.

Although the result of focus detection by the contrast AF has beendescribed above, similar processing can also be performed on the resultof focus detection by the phase-difference AF. The amount of change of acorrelation amount calculated in correlation calculation in thephase-difference AF may be used as a coefficient of the weighting in thecorrection value calculation. In this case, the fact that the amount ofchange of the correlation amount is larger as the amount of the contrastinformation of the subject is larger is used, as in the case where adifference between brightness and darkness of the subject is large, orin the case where the number of edges with a difference in brightnessand darkness is large. The evaluation value is not limited to the amountof change of the correlation amount and may be any kind of evaluationvalue, as long as a similar relationship is obtained therewith.

Thus, by correcting the focus detection result using thevertical/horizontal BP correction value, accurate focus detection can beperformed regardless of the amount of the contrast information of thesubject in each direction. Furthermore, since the horizontal andvertical correction values are calculated using the common correctioninformation such as that shown in FIG. 8A, the storage capacity for thecorrection information can be reduced as compared with the case ofstoring the correction values for respective directions.

If the focus detection results in the respective directions aresignificantly different, the vertical/horizontal BP correction value isnot calculated using these focus detection results, and the influence ofa shifting of focus can thereby be reduced. Furthermore, in the casewhere a shifting of focus is assumed as well, more accurate correctioncan be performed by weighting the correction values based on which ofthe focus evaluation values in the respective directions are large orsmall.

Method for Calculating Color BP Correction Value

Next, a description will be given, using FIGS. 9A to 9C, of a method ofthe color BP correction value (BP2) calculation performed in step S21 inFIG. 1A. FIG. 9A is a flowchart showing the details of the color BPcorrection value (BP2) calculation processing.

In step S200, the camera MPU 125 obtains color BP correctioninformation. The color BP correction information is information of adifference between an in-focus position detected using a green (G)signal and an in-focus position detected using signals of other colors(red (R), blue (B)). In the present embodiment, the color BP correctioninformation is stored in advance in the lens memory 118 in the lens unit100, and the camera MPU 125 obtains the color BP correction informationby requesting it from the lens MPU 117. However, the color BP correctioninformation may be stored in the nonvolatile area of the camera RAM 125b.

As the number of divided zones is larger, a more accurate correctionvalue suitable for the position of the first lens group 101 and theposition of the focusing lens 104 in the imaging optical system can beobtained. Also, the color BP correction information can be used in boththe contrast AF and the phase-difference AF.

In step S200, the camera MPU 125 obtains the correction valuecorresponding to the zoom position and the focusing lens positionsuitable for a correction target focus detection result.

In step S201, the camera MPU 125 calculates the color BP correctionvalue. If, in step S200, BP_R has been obtained as one element in FIG.9B, and BP_B has been obtained as one element in FIG. 9C, the camera MPU125 calculates the color BP correction value BP2 in accordance withEquation (4) below.BP2=K_R×BP_R+K_B×BP_B  (4)

Here, K_R and K_B are coefficients for correction information ofrespective colors. These coefficients are values correlating with arelationship regarding which the volumes of the red (R) and blue (B)information with respect to the volume of the green (G) informationcontained in the subject is larger, K_R takes a larger value withrespect to a subject containing a large amount of red color, and K_Btakes a larger value with respect to a subject containing a largeramount of blue color. Both K_R and K_B take small values with respect toa subject containing a larger amount of green color. K_R and K_B may beset in advance based on representative spectral information of thesubject. If the spectral information of the subject can be detected, K_Rand K_B may be set in accordance with the spectral information of thesubject. After the calculation of the color BP correction value in stepS202 ends, the camera MPU 125 ends the color BP correction valuecalculation processing.

Note that, although the correction values are stored in the form oftables for respective focus detection regions as shown in FIGS. 8A and9A to 9C in the present embodiment, the method for storing thecorrection values is not limited thereto. For example, a configurationmay be employed in which a coordinate system is set with theintersecting point of the image sensor and the optical axis of theimaging optical system as an origin, and the horizontal and verticaldirections of the image capture apparatus respectively as an X axis anda Y axis, and the correction value at the center coordinates of thefocus detection region is obtained using a function of X and Y. In thiscase, the volume of information to be stored as the focus detectioncorrection values can be reduced.

In the present embodiment, the correction value used in focus detectionin which calculation is performed using the vertical/horizontal BPcorrection information or the color BP correction information iscalculated, assuming that the correction value does not depend onspatial frequency information that the pattern of a subject has. Forthis reason, accurate correction can be performed without increasing theamount of correction information to be stored. However, the method forcalculating the correction value is not limited thereto. As with alater-described method for calculating the spatial frequency BPcorrection value, a correction value may be calculated in accordancewith spatial frequency components of a subject, using thevertical/horizontal BP correction information or the color BP correctioninformation with respect to each spatial frequency.

Method for Calculating Spatial Frequency BP Correction Value

Next, a description will be given, using FIGS. 10A to 10C, of a methodof the spatial frequency BP correction value (BP3) calculation performedin step S22 in FIG. 1A. FIG. 10A is a flowchart showing the details ofthe spatial frequency BP correction value (BP3) calculation processing.

In step S300, the camera MPU 125 obtains spatial frequency BP correctioninformation. The spatial frequency BP correction information isinformation regarding an image forming position in the imaging opticalsystem with respect to each spatial frequency of a subject. In thepresent embodiment, the spatial frequency BP correction information isstored in advance in the lens memory 118 in the lens unit 100, and thecamera MPU 125 obtains the spatial frequency BP correction informationby requesting it from the lens MPU 117. However, the spatial frequencyBP correction information may be stored in the nonvolatile area of thecamera RAM 125 b.

Exemplary spatial frequency BP correction information will be describedusing FIG. 10B showing a defocus MTF (Modulation Transfer Function) ofthe imaging optical system. The horizontal and vertical axes in FIG. 10Bshow the position of the focusing lens 104 and the intensity of the MTF,respectively. Four curves shown in FIG. 10B are MTF curves with respectto respective spatial frequencies, and indicate the case where thespatial frequency changes from low to high frequencies in the order ofMTF1, MTF2, MTF3, and MTF4. The MTF curve of a spatial frequency F1 (1p/mm) corresponds to MTF1, and similarly, spatial frequencies F2, F3,and F4 (1 p/mm) correspond to MTF2, MTF3, and MTF4, respectively. LP4,LP5, LP6, and LP7 indicate the positions of the focusing lens 104corresponding to the local maximum values of the respective defocus MTFcurves. Note that the stored spatial frequency BP correction informationis obtained by discretely sampling the curves in FIG. 10B. As anexample, in the present embodiment, MTF data for 10 focusing lenspositions are sampled with respect to one MTF curve, and for example, 10sets of data is stored as MTF1(n) (1≤n≤10) with respect to MTF1.

The zoom position (angle of view) of the imaging optical system and thefocusing lens position (in-focus distance) are divided into 8 zones ateach position in the focus detection region, and the spatial frequencyBP correction information of each zone is stored, similarly to thevertical/horizontal BP correction information and the color BPcorrection information. As the number of divided zones is larger, a moreaccurate correction value suitable for the position of the first lensgroup 101 and the position of the focusing lens 104 in the imagingoptical system can be obtained. Also, the spatial frequency BPcorrection information can be used in both the contrast AF and thephase-difference AF.

In step S300, the camera MPU 125 obtains the correction valuecorresponding to the zoom position and the focusing lens positionsuitable for a correction target focus detection result.

In step S301, the camera MPU 125 calculates a band of a signal used whenperforming the contrast AF and the phase-difference AF in the correctiontarget focus detection region. In the present embodiment, the camera MPU125 calculates an AF evaluation band while considering the influence ofa subject, the imaging optical system, the sampling frequency of theimage sensor, and a digital filter used in the evaluation. A method forcalculating the AF evaluation band will be described later.

Next, in step S302, the camera MPU 125 calculates a band of a signalused in a photographic image. As in the calculation of the AF evaluationband in step S302, the camera MPU 125 calculates a photographic imageevaluation band, while considering the influence of the subject, theimaging optical system, frequency characteristics of the image sensor,and an evaluation band of a person who appreciates the photographicimage.

Calculation of the AF evaluation band (second evaluation band) and thephotographic image evaluation band (first evaluation band) performed insteps S301 and S302 will now be described using FIGS. 11A to 11F. FIGS.11A to 11F indicates intensities with respect to the respective spatialfrequencies, with the horizontal and vertical axes respectivelyindicating the spatial frequency and the intensity.

FIG. 11A shows a spatial frequency characteristic (I) of the subject.F1, F2, F3, and F4 on the horizontal axis are spatial frequenciescorresponding to the MTF curves (MTF1 to MTF4) in FIG. 10B. Nq indicatesa Nyquist frequency, which is determined by the pixel pitch of the imagesensor 122. F1 to F4 and Nq are also similarly shown in FIGS. 11B to11F, which will be described below. In the present embodiment, arepresentative value stored in advance is used as the spatial frequencycharacteristic (I) of the subject. The spatial frequency characteristic(I) of the subject, which is indicated by a continuous curve in FIG.11A, has discrete values I(n) (1≤n≤4) corresponding to the spatialfrequencies F1, F2, F3, and F4.

Although the present embodiment uses the representative value stored inadvance as the spatial frequency characteristic of the subject, thespatial frequency characteristic of the subject to be used may bechanged in accordance with the subject for which focus detection isperformed. The spatial frequency information (power spectrum) of thesubject can be obtained by applying FFT processing or the like on animage signal obtained by imaging. In this case, although the amount ofcalculation processing increases, a correction value suitable for asubject for which focus detection is actually performed can becalculated, and accordingly accurate focus detection can be performed.More simply, some kinds of spatial frequency characteristics stored inadvance may be appropriately used depending on whether the contrastinformation of the subject is large or small.

FIG. 11B shows a spatial frequency characteristic (O) of the imagingoptical system. This information may be obtained through the lens MPU117, or may be stored in the RAM 125 b in the camera. The storedinformation may be the spatial frequency characteristics in respectivedefocus states, or may be only a spatial frequency characteristic in anin-focus state. Since the spatial frequency BP correction value iscalculated near an in-focus position, accurate correction can beperformed using the spatial frequency in an in-focus state. However,more accurate focus adjustment can be performed using the spatialfrequency characteristics in respective defocus states, although acalculation load increases. The spatial frequency characteristic in adefocus state to be used may be selected using the defocus amountobtained by the phase-difference AF.

The spatial frequency characteristic (O) of the imaging optical system,which is indicated by a continuous curve in FIG. 11B, has discretevalues O(n) (1≤n≤4) corresponding to the spatial frequencies F1, F2, F3,and F4.

FIG. 11C shows a spatial frequency characteristic (L) of the optical lowpass filter 121. This information is stored in the RAM 125 b within thecamera. The spatial frequency characteristic (L) of the optical low passfilter 121, which is indicated by a continuous curve in FIG. 11C, hasdiscrete values L(n) (1≤n≤4) corresponding to the spatial frequenciesF1, F2, F3, and F4.

FIG. 11D shows spatial frequency characteristics (M1, M2) at the time ofsignal generation. As mentioned above, the image sensor in the presentembodiment has two readout modes. In the first readout mode, i.e., inthe all-pixel readout mode, the spatial frequency characteristic doesnot change when generating a signal, as indicated by M1. On the otherhand, in the second readout mode, i.e., in the thinning readout mode,the spatial frequency characteristic changes when generating a signal,as indicated by M2. As mentioned above, signals are added at the time ofthe thinning in the X direction to improve the S/N ratio, and thereforea low-pass effect is generated by the addition. M2 in FIG. 11D indicatesthe spatial frequency characteristic at the time of generating a signalin the second readout mode. Here, the low pass effect achieved by theaddition is shown without taking the influence of the thinning intoconsideration.

The spatial frequency characteristics (M1, M2) at the time of signalgeneration, which are indicated by continuous curves in FIG. 11D, havediscrete values M1(n) and M2(n) (1≤n≤4) corresponding to the spatialfrequencies F1, F2, F3, and F4.

FIG. 11E shows a spatial frequency characteristic (D1) indicating thesensitivity with respect to each spatial frequency at the time ofappreciating a photographic image, and a spatial frequencycharacteristic (D2) of a digital filter used in processing of an AFevaluation signal. The sensitivity with respect to each spatialfrequency at the time of appreciating a photographic image is affectedby individual differences of a person who appreciate the image, theimage size, the distance at the time of appreciating the image, theenvironment in which the image is appreciated, such as the brightness,and the like. In the present embodiment, the sensitivity with respect toeach spatial frequency at the time of appreciation is set and stored asa representative value.

On the other hand, in the second readout mode, folding noise (aliasing)of frequency components of a signal is generated due to the influence ofthe thinning. The spatial frequency characteristic of the digital filteris indicated by D2, taking this influence into consideration.

The spatial frequency characteristic (D1) at the time of appreciationand the spatial frequency characteristic (D2) of the digital filter,which are indicated by continuous curves in FIG. 11E, have discretevalues D1(n) and D2(n) (1≤n≤4) corresponding to the spatial frequenciesF1, F2, F3, and F4.

By thus storing various kinds of information in either the camera or thelens, the camera MPU 125 calculates a photographic image evaluation bandW1 and an AF evaluation band W2, based on Equations (5) and (6) below.W1(n)=I(n)×O(n)×L(n)×M1(n)×D1(n)(1≤n≤4)  (5)W2(n)=I(n)×O(n)×L(n)×M2(n)×D2(n)(1≤n≤4)  (6)

FIG. 11F shows the photographic image evaluation band W1 (firstevaluation band) and the AF evaluation band W2 (second evaluation band).By performing calculation of Equations (5) and (6), a degree of theinfluence that factors determining an in-focus state of the photographicimage have with respect to each spatial frequency can be quantified.Similarly, a degree of the influence that an error in the focusdetection results has with respect to each spatial frequency can bequantified.

The information stored in the camera may be W1 and W2 that arecalculated in advance. As described above, when the digital filter orthe like used in the AF evaluation is changed, the correction value canbe calculated while flexibly responding to this change, by performingthe calculation every time the correction is performed. On the otherhand, if W1 and W2 are store in advance, the calculation of Equations(5) and (6) and the storage capacity for various data can be reduced.

Since all calculation does not need to be finished in advance, aconfiguration may also be employed in which, for example, only thespatial frequency characteristics of the imaging optical system and thesubject are calculated in advance and stored in the camera, therebyreducing the data storage capacity and the amount of calculation.

FIGS. 11A to 11F have been described using the discrete valuescorresponding to four spatial frequencies (F1 to F4), for the purpose ofsimplification of the description. However, a larger number of spatialfrequencies with respect to which data is held will lead to more correctreproduction of the spatial frequency characteristics of thephotographic image and the AF evaluation band, and the correction valuecan be accurately calculated. On the other hand, the amount ofcalculation can be reduced by reducing the number of spatial frequenciesto be weighted. The subsequent calculation may be performed whileholding one spatial frequency representing the photographic imageevaluation band and one spatial frequency representing the AF evaluationband spatial frequency.

Returning to FIG. 10A, in step S303, the camera MPU 125 calculates thespatial frequency BP correction value (BP3). When calculating thespatial frequency BP correction value, the camera MPU 125 initiallycalculates a defocus MTF (C1) of the photographic image and a defocusMTF (C2) of a focus detection signal. C1 and C2 are calculated using thedefocus MTF information obtained in step S300 and the evaluation bandsW1 and W2 obtained in steps S301 and S302, in accordance with Equation(7) below.C1(n)=MTF1(n)×W1(1)+MTF2(n)×W1(2)+MTF3(n)×W1(3)+M TF4(n)×W1(4)  (7)C2(n)=MTF1(n)×W2(1)+MTF2(n)×W2(2)+MTF3(n)×W2(3)+M TF4(n)×W2(4)  (8)

Thus, the defocus MTF information with respect to the respective spatialfrequencies shown in FIG. 10B is added based on the weighting of theevaluation bands of the photographic image and the AF calculated insteps S301 and S302, and the defocus MTF (C1) of the photographic imageand the defocus MTF (C2) of the AF are obtained. FIG. 10C shows C1 andC2, which are the two obtained defocus MTFs. The horizontal and verticalaxes respectively indicate the position of the focusing lens 104 and theMTF value obtained by performing weighted addition with respect to eachspatial frequency. The camera MPU 125 detects a local maximum valueposition of each MTF curve. P_img (first image forming position) isdetected as the position of the focusing lens 104 corresponding to thelocal maximum value of the curve C1. P_AF (second image formingposition) is detected as the position of the focusing lens 104corresponding to the local maximum value of the curve C2.

In step S303, the camera MPU 125 calculates the spatial frequency BPcorrection value (BP3) using Equation (9) below.BP3=P_AF−P_img  (9)

With Equation (9), the correction value for correcting an error that maypossibly occur between the in-focus position of the photographic imageand the in-focus position detected by the AF can be calculated.

As described above, the in-focus position of the photographic imagechanges depending on the spatial frequency characteristics of thesubject, the imaging optical system, and the optical low pass filter,the spatial frequency characteristics at the time of signal generation,the spatial frequency characteristics indicating the sensitivity withrespect to each frequency at the time of appreciation, image processingperformed on the photographic image, and the like. In the presentembodiment, an in-focus position of the photographic image can beaccurately calculated by going back to a process of generating thephotographic image and calculating the spatial frequencycharacteristics. For example, the in-focus position of the photographicimage is changed in accordance with the recording size of thephotographic image, super-resolution processing performed in imageprocessing, sharpness, or the like. Furthermore, the image size or themagnification ratio with which the photographic image after beingrecorded is appreciated, the appreciating distance at which thephotographic image is appreciated, and the like affect the evaluationband of the appreciating person. The in-focus position of thephotographic image is changed by setting characteristics in whichhigh-frequency components of the evaluation band of the appreciatingperson are more weighted as the image size is larger, and as theappreciating distance is shorter.

On the other hand, the in-focus position detected by the AF similarlychanges depending on the spatial frequency characteristics of thesubject, the imaging optical system, and the optical low pass filter,the spatial frequency characteristics at the time of signal generation,the digital filter spatial frequency used in the AF evaluation, and thelike. In the present embodiment, the spatial frequency characteristicsare calculated by going back to the process of generating a signal usedin the AF, and the in-focus position detected by the AF can thereby beaccurately calculated. For example, the AF in the first readout mode canalso be flexibly handled. In this case, a weighting coefficient needonly be calculated by changing the spatial frequency characteristics atthe time of signal generation to characteristics corresponding to thefirst readout mode.

Since the image capture apparatus described in the present embodiment isa lens-interchangeable single-lens reflex camera, the lens unit 100 canbe replaced. If the lens unit 100 is replaced, the lens MPU 117transmits the defocus MTF information corresponding to the respectivespatial frequencies to the camera body 120. The camera MPU 125 thencalculates the in-focus position of the photographic image and thein-focus position detected by the AF, and accordingly the correctionvalue can be accurately calculated for each interchangeable lens. Thelens unit 100 may transmit not only the defocus MTF information but alsoinformation such as the spatial frequency characteristic of the imagingoptical system to the camera body 120. The way of making use of thisinformation is as described above.

Similarly, if the camera body 120 is replaced, the pixel pitch,characteristics of the optical low pass filter, or the like changes insome cases. As described above, in this case as well, the correctionvalue suitable for the characteristics of the camera body 120 iscalculated, and accordingly accurate correction can be performed.

Although the correction value is calculated by the camera MPU 125 in theabove description, the calculation may be performed by the lens MPU 117.In this case, a configuration may be employed in which the camera MPU125 transmits, to the lens MPU 117, various kinds of information thathas been described using FIGS. 11A to 11F, and the lens MPU 117calculates the correction value using the defocus MTF information andthe like. In this case, in step S24 in FIG. 1A, the lens MPU 117 needonly correct the in-focus position transmitted from the camera MPU 125and drive the lens.

In the present embodiment, the correction value for the AF is calculatedwhile paying attention to the characteristics (vertical/horizontal,color, spatial frequency band) of the signal used in focus detection.For this reason, the correction value can be calculated using a similarmethod, regardless of the AF method. Since the correction method anddata to be used in the correction do not need to be held for each AFmethod, the data storage capacity and the calculation load can bereduced.

Second Embodiment

Next, a second embodiment of the present invention will be described. Amajor difference from the first embodiment lies in the method forcalculating the spatial frequency BP correction value. In the firstembodiment, the defocus MTF information is used as the valuerepresenting the characteristics of the imaging optical system withrespect to the respective spatial frequencies. However, the data volumeof the defocus MTF information is large, which increases the storagecapacity and the calculation load. For this reason, in the secondembodiment, the spatial frequency BP correction value is calculatedusing local maximum value information of the defocus MTF. It is therebypossible to achieve saving of the capacity of the lens memory 118 or theRAM 125 b, a reduction in the amount of communication between the lensand camera, and a reduction in the load of the calculation performed bythe camera MPU 125, for example.

Note that the block diagram (FIG. 2 ) of the image capture apparatus,the diagrams (FIGS. 3A to 5 ) illustrating the focus detection methods,the diagram (FIG. 6 ) illustrating the focus detection regions, and theflowcharts (FIGS. 1A, 1B, 7, and 9A) of the focus detection processingand various kinds of BP correction value calculation processing will bealso used in the present embodiment. The flowchart (FIG. 10A) of thespatial frequency BP correction value calculation processing and thediagrams (FIGS. 11A to 11F) illustrating the evaluation bands will alsobe used.

A method for calculating the spatial frequency BP correction value (BP3)in the present embodiment will now be described using FIG. 12 .

In step S300, the camera MPU 125 obtains spatial frequency BP correctioninformation.

FIG. 12 shows positions of the focusing lens 104 at which the defocusMTFs take their local maximum values with respect to respective spatialfrequencies, which are characteristics of the imaging optical system.The focusing lens positions LP4, LP5, LP6, and LP7 at which the defocusMTFs reach their peaks (local maximum values) with respect to thediscrete spatial frequencies F1 to F4 shown in FIG. 10B are shown alongthe vertical axis. In the present embodiment, LP4 to LP7 are stored asMTF_P(n) (1≤n≤4) in the lens memory 118 or the RAM 125 b. The storedinformation is associated with the position of the focus detectionregion, the zoom position, and the focusing lens position, as in thefirst embodiment.

In the second embodiment, in step S300 in the spatial frequency BPcorrection value processing shown in FIG. 10A, the camera MPU 125obtains a correction value corresponding to the zoom position and thefocusing lens position suitable for a correction target focus detectionresult.

In steps S301 and S302, the camera MPU 125 performs processing similarto that in the first embodiment.

In step S303, the camera MPU 125 calculates the spatial frequency BPcorrection value (BP3). When calculating the spatial frequency BPcorrection value, the camera MPU 125 initially calculates an in-focusposition (P_img) of the photographic image and an in-focus position(P_AF) detected by the AF, in accordance with Equations (10) and (11)below. The calculation uses the defocus MTF information MTF_P(n)obtained in step S300 and the evaluation bands W1 and W2 obtained insteps S301 and S302.P_img=MTF_P(1)×W1(1)+MTF_P(2)×W1(2)+MTF_P(3)×W1(3)+MTF_P(4)×W1(4)  (10)P_AF=MTF_P(1)×W2(1)+MTF_P(2)×W2(2)+MTF_P(3)×W2(3)+MTF_P(4)×W2(4)  (11)

That is to say, the local maximum value information MTF_P(n) of thedefocus MTF with respect to each spatial frequency shown in FIG. 12 issubjected to weighted addition using the evaluation bands W1 and W2 ofthe photographic image and the AF calculated in steps S301 and S302. Thein-focus position (P_img) of the photographic image and the in-focusposition (P_AF) detected by the AF are thereby calculated.

Next, the camera MPU 125 calculates the spatial frequency BP correctionvalue (BP3) as in the first embodiment, using Equation (9) below.BP3=P_AF−P_img  (9)

In the present embodiment, the spatial frequency BP correction value canbe calculated more easily. Although the accuracy of the spatialfrequency BP correction value in the present embodiment is slightlylower than that in the first embodiment, it is possible to achieve areduction in the amount of information stored for calculating thespatial frequency BP correction value, a reduction in the amount ofcommunication between the lens and the camera, and a reduction in theload of the calculation performed by the camera MPU 125.

Third Embodiment

Next, a third embodiment of the present invention will be described. Inthe present embodiment as well, the method for calculating the spatialfrequency BP correction value is different from those in the aboveembodiments. In the present embodiment, the spatial frequency BPcorrection value is not calculated when the calculation is notnecessary, thereby reducing the amount of communication between the lensand camera and reducing the load of the calculation performed by thecamera MPU 125, while not lowering the accuracy of the spatial frequencyBP correction value.

Note that the block diagram (FIG. 2 ) of the image capture apparatus,the diagrams (FIGS. 3A to 5 ) illustrating the focus detection methods,the diagram (FIG. 6 ) illustrating the focus detection regions, and theflowcharts (FIGS. 1A, 1B, 7, and 9A) of the focus detection processingand various kinds of BP correction value calculation processing will bealso used in the present embodiment. The diagrams (FIGS. 10B to 10C)relating to the spatial frequency BP correction value calculationprocessing will also be used.

A method for calculating the spatial frequency BP correction value (BP3)in the present embodiment will now be described using a flowchart inFIG. 13 . Processing in FIG. 13 that is similar to processing in FIG.10A will be given the same reference numeral, and a redundantdescription will be omitted.

In step S3000, the camera MPU 125 determines whether or not the spatialfrequency BP correction value needs to be calculated. As is understoodfrom the description of the first embodiment, the more similar thephotographic image evaluation band W1 and the AF evaluation band W2 are,the smaller the spatial frequency BP correction value is. For thisreason, in the present embodiment, if it is determined that thedifference between the two evaluation bands is small to the extent towhich the spatial frequency BP correction value does not need to becalculated, the calculation of the correction value is omitted.

Specifically, the calculation of the correction value is omitted if acondition is satisfied under which the difference between the twoevaluation bands is sufficiently small. For example, if the signal usedin the AF is also a signal read out in the first mode, the photographicimage evaluation band is equal to the AF evaluation band. Furthermore,when using, in processing of AF evaluation signal, a digital filterhaving a spatial frequency characteristic similar to the spatialfrequency characteristic indicating the sensitivity with respect to eachspatial frequency at the time of appreciating the photographic image,the spatial frequency characteristic at the time of appreciation isequal to the spatial frequency characteristic of the digital filter.This situation occurs in the case of displaying an image to be displayedon the display 126 in an enlarging manner, for example.

Similarly, it is assumed that the photographic image evaluation band isequal to the AF evaluation band when the photographic image is generatedusing the signal which is read out in the second readout mode. Thissituation occurs in the case where the size of a recorded image of thephotographic image is set to be small.

If, in step S3000, any of such predetermined conditions is satisfied,the camera MPU 125 determines that the calculation of the correctionvalue is not necessary, and advances the processing to step S3001.

In step S3001, since the correction value is not calculated, the cameraMPU 125 substitutes 0 for BP3, and ends the spatial frequency BPcorrection value (BP3) calculation processing.

On the other hand, if it is determined in step S3000 that thecalculation of the correction value is necessary, the camera MPU 125performs steps S300 to S303 as in the first embodiment (or the secondembodiment).

Since the present embodiment thus omits the calculation of thecorrection value if it is determined that the calculation of the spatialfrequency BP correction value is not necessary, the amount of datacommunication and the calculation load at the time of calculating thecorrection value can be reduced, although the volume of data stored forcalculating the correction value cannot be reduced. Note that thepresent embodiment can be combined with the second embodiment, and inthis case, the amount of data communication and the calculation load atthe time of calculating the correction value can be further reduced, notto mention a reduction in the volume of data stored for calculating thecorrection value.

Although the present embodiment has described the omission of thespatial frequency BP correction value, the vertical/horizontal BPcorrection value and the color BP correction value can also be omitted,if it is determined that these correction values are not necessary. Forexample, when performing focus detection while considering both thevertical and horizontal contrast, the calculation of thevertical/horizontal BP correction value may be omitted. If a colorsignal used in the photographic image is equal to a color signal used infocus detection, the calculation of the color BP correction value may beomitted.

Fourth Embodiment

Next, a fourth embodiment of the present invention will be described.The present embodiment is different from the first embodiment mainly inthe methods for calculating various BP correction values. In the presentembodiment, the vertical/horizontal BP correction value, the color BPcorrection value, and the spatial frequency BP correction value arecalculated as different correction values. However, since thevertical/horizontal BP correction value and the color BP correctionvalue also depend on the spatial frequency, the vertical/horizontal BPcorrection value and the color BP correction value are also calculatedwhile considering the spatial frequency in the fourth embodiment. Thecorrection values can thereby be calculated more accurately, althoughthe capacity necessary for the lens memory 118 or the RAM 125 bincreases. Furthermore, a reduction in the amount of calculation can beachieved by changing the order of calculation of the BP correctionvalues, information of temporarily stored coefficients, and the like.

Note that the block diagram (FIG. 2 ) of the image capture apparatus,the diagrams (FIGS. 3A to 5 ) illustrating the focus detection methods,the diagram (FIG. 6 ) illustrating the focus detection region, and thediagrams (FIGS. 11A to 11F) illustrating the evaluation bands are commonin the present embodiment, and accordingly will also be used in thefollowing description.

A method for calculating a BP correction value (BP) in the presentembodiment will now be described using FIGS. 14 to 17 .

In FIG. 14 , processing similar to the focus detection processing in thefirst embodiment are given the same reference numerals as those in FIG.1A. FIG. 14 is different from FIG. 1A in that steps S20 to S22 arereplaced with step S400, and step S23 is replaced with step S401. Instep S400, the camera MPU 125 calculates a BP correction value (BP) forcollectively correcting various error factors, such as the direction(vertical/horizontal), the color, and the spatial frequency.

In step S401, the camera MPU 125 corrects the focus detection resultDEF_B using the calculated BP correction values (BP) in accordance withEquation (12), and calculates a focus detection result DEF_A after thecorrection.DEF_A=DEF_B+BP  (12)

In the present embodiment, the BP correction value is calculated usinginformation of the positions of the focusing lens 104 indicating localmaximum values of the defocus MTF of six spatial frequencies, which arecombinations of three colors, namely red (R), green (G), and blue (B),and two directions, namely vertical and horizontal directions. It isthereby possible to consider the dependency of the color and thedirection (vertical and horizontal) on the spatial frequencies,calculate a more accurate BP correction value, and improve thecorrection accuracy.

FIG. 15 is a flowchart showing the details of the BP correction valuecalculation processing in step S400 in FIG. 14 .

In step S500, the camera MPU 125 obtains parameters (calculationconditions) necessary for calculating the BP correction value. Asdescribed in the first embodiment, the BP correction value changes witha change of the imaging optical system and a change of the focusdetection optical system, such as a change of the position of thefocusing lens 104, the position of the first lens group 101 indicating azoom state, and the position of the focus detection region. For thisreason, in step S500, the camera MPU 125 obtains information of theposition of the focusing lens 104, the position of the first lens group101 indicating the zoom state, and the position of the focus detectionregion, for example. Furthermore, in step S500, the camera MPU 125obtains setting information regarding colors and evaluation directionsof the signal used in focus detection and the signal used in thephotographic image.

FIG. 16A shows exemplary setting information regarding the colors andthe evaluation directions. This setting information is informationindicating the degree of weighting with respect to combinations of thecolors (red, green, and blue) and the directions (horizontal andvertical) of contrast with which a focus condition is evaluated. Thesetting information for focus detection is different from the settinginformation for the photographic image. For example, when correcting aresult of the contrast AF using a horizontal green signal, the settinginformation for focus detection may be defined as follows:

-   -   K_AF_RH=0    -   K_AF_GH=1    -   K_AF_BH=0    -   K_AF_RV=0    -   K_AF_GV=0    -   K_AF_BV=0        With the above setting information, it can be indicated that the        information of the defocus MTF peak of the signal for focus        detection is the same as the characteristic of the horizontal        green signal.

On the other hand, the setting information for the photographic imagemay be defined as follows:

-   -   K_IMG_RH=0.15    -   K_IMG_GH=0.29    -   K_IMG_BH=0.06    -   K_IMG_RV=0.15    -   K_IMG_GV=0.29    -   K_IMG_BV=0.06        These are values set by assuming that weighting for converting        RGB signals is performed so as to be equivalent to Y signals,        the photographic image is evaluated based on the Y signals, and        both the horizontal contrast and the vertical contrast are        equally evaluated. However, set values, types of the set values,        and the like are not limited thereto.

In step S501, the camera MPU 125 determines whether or not alater-described peak coefficient has been changed. This determination isperformed in order to omit recalculation of the peak coefficient, in thecase where various conditions are identical in previously-performed BPcorrection value calculation and the current BP correction valuecalculation. In the present embodiment, the camera MPU 125 determinesthat the peak coefficient has not been changed if there has been nochange in the setting information (FIG. 16A) regarding the color and theevaluation direction for focus detection and the photographic image andin the position of the focus detection region, and advances theprocessing to step S505, skipping steps S502 to S504.

If, in step S501, the peak coefficient is calculated for the first time,or if it is determined that the peak coefficient has been changed, thecamera MPU 125 advances the processing to step S502 and obtains the BPcorrection information. The BP correction information is informationregarding the image forming position in the imaging optical system withrespect to each spatial frequency of a subject. Each of theaforementioned six combinations of the three colors and the twodirections is expressed by Equation (13) below, with the spatialfrequency f and the position (x, y) of the focus detection region on theimage sensor as variables.

$\begin{matrix}{{{MTF\_ P}{\_ RH}\left( {f,x,y} \right)} = {{\left( {{{{rh}(0)} \times x} + {{{rh}(1)} \times y} + {{rh}(2)}} \right) \times f\; 2} + {\left( {{{{rh}(3)} \times x} + {{{rh}(4)} \times y} + {{rh}(5)}} \right) \times f} + \left( {{{{rh}(6)} \times x} + {{{rh}(7)} \times y} + {{rh}(8)}} \right)}} & (13)\end{matrix}$

Note that, although Equation (13) is an equation of information MTF_P_RHof the position of the focusing lens 104 at which the defocus MTF withrespect to each spatial frequency of a red (R) signal corresponding tothe horizontal (H) direction takes its local maximum value, othercombinations are also expressed by similar expressions. In the presentembodiment, rh(n) (0≤n≤8) is stored in advance in the lens memory 118 inthe lens unit 100, and the camera MPU 125 obtains rh(n) (0≤n≤8) byrequesting it from the lens MPU 117. However, rh(n) (0≤n≤8) may bestored in the nonvolatile area of the camera RAM 125 b.

Coefficients (rv, gh, gv, bh, and bv) in each of the combinations of“red and vertical” (MTF_P_RV), “green and horizontal” (MTF_P_GH), “greenand vertical” (MTF_P_GV), “blue and horizontal” (MTF_P_BH), and “blueand vertical” (MTF_P_BV) may also be similarly stored and obtained.

Next, in step S503, the camera MPU 125 performs, with respect to theobtained BP correction information, weighting relating to the positionof the focus detection region, the color of an evaluation signal, andthe contrast direction. Initially, the camera MPU 125 calculates the BPcorrection information using the information regarding the position ofthe focus detection region at the time of calculating the BP correctionvalue.

Specifically, the focus detection region position information issubstituted for x and y in Equation (13). With this calculation,Equation (13) is expressed in the form of Equation (14) below.MTF_P_RHF=Arh×f2+Brh×f+Crh  (14)

The camera MPU 125 also similarly calculates MTF_P_RVF, MTF_P_GHF,MTF_P_GVF, MTF_P_BHF, and MTF_P_BVF. These correspond to defocus MTFintermediate information.

FIG. 16B shows exemplary BP correction information after substitutingthe focus detection region position information in step S503, with thehorizontal and vertical axes respectively indicating the spatialfrequency and the position (peak position) of the focusing lens 104 atwhich the defocus MTF takes its local maximum value. As shown in FIG.16B, the curves of the respective colors separate from each other whenthe chromatic aberration is large, and the curves of the horizontal andvertical directions in FIG. 16B separate from each other when thevertical/horizontal difference is large. Thus, in the presentembodiment, each combination of the colors (RGB) and the evaluationdirections (H and V) has the defocus MTF information corresponding tothe respective spatial frequencies. The BP correction value can therebybe accurately calculated.

Next, the camera MPU 125 weights 12 coefficients (FIG. 16A) constitutingthe setting information obtained in step S500, using the BP correctioninformation. The setting information is thereby weighted in relation tothe colors and directions evaluated in focus detection and imaging.Specifically, the camera MPU 125 calculates a spatial frequencycharacteristic MTF_P_AFF for focus detection and a spatial frequencycharacteristic MTF_P_IMGF for the photographic image, using Equations(15) and (16).

$\begin{matrix}{{{MTF\_ P}{\_ AFF}} = {{{K\_ AF}{\_ RH} \times {MTF\_ P}{\_ RHF}} + {{K\_ AF}{\_ RV} \times {MTF\_ P}{\_ RVF}} + {{K\_ AF}{\_ GH} \times {MTF\_ P}{\_ GHF}} + {{K\_ AF}{\_ BH} \times {MTF\_ P}{\_ BHF}} + {{K\_ AF}{\_ BV} \times {MTF\_ P}{\_ BVF}}}} & (15) \\{{{MTF\_ P}{\_ IMGF}} = {{{K\_ IMG}{\_ RH} \times {MTF\_ P}{\_ RHF}} + {{K\_ IMG}{\_ RV} \times {MTF\_ P}{\_ RVF}} + {{K\_ IMG}{\_ GH} \times {MTF\_ P}{\_ GHF}} + {{K\_ IMG}{\_ GV} \times {MTF\_ P}{\_ GVF}} + {{K\_ IMG}{\_ BH} \times {MTF\_ P}{\_ BHF}} + {{K\_ IMG}{\_ BV} \times {MTF\_ P}{\_ BVF}}}} & (16)\end{matrix}$

FIG. 16C shows an example of MTF_P_AFF and MTF_P_IMGF in the same formas that in FIG. 16B. In the present embodiment, thus, variables relatingto the position of the focus detection region and the evaluated colorsand directions are calculated prior to the calculation relating tovariables of the spatial frequency. As a result of the calculation,MTF_P_AFF and MTF_P_IMGF are expressed in the forms of Equations (17)and (18) below:MTF_P_AFF=Aaf×f2+Baf×f+Caf  (17)MTF_P_IMGF=Aimg×f2+Bimg×f+Cimg  (18)

FIG. 16C shows, on the vertical axis, the focusing lens positions (peakpositions) LP4_AF, LP5_AF, LP6_AF, and LP7_AF at which the defocus MTFsobtained by substituting discrete spatial frequencies F1 to F4 inEquation (17) reach their peaks (local maximum values).

In step S504, the camera MPU 125 stores LP4_AF to LP7_AF as a peakcoefficient MTF_P_AF(n) (1≤n≤4) in the lens memory 118 or the RAM 125 b.The camera MPU 125 also stores LP4_Img to LP7_Img as a peak coefficientMTF_P_Img(n) (1≤n≤4) in the lens memory 118 or the RAM 125 b, andadvances the processing to step S505.

Next, in step S505, the camera MPU 125 determines whether or not theevaluation band of a signal for focus detection or for the photographicimage has been changed, and if not, the camera MPU 125 advances theprocessing to step S507 and calculates the BP correction value. Whencalculating the BP correction value, the camera MPU 125 initiallycalculates the in-focus position (P_img) of the photographic image andthe in-focus position (P_AF) detected by the AF, in accordance withEquations (19) and (20), as in the second embodiment. The calculationuses the evaluation bands W1 and W2 obtained in steps S301 and S302 inthe first embodiment.P_img=MTF_P_Img(1)×W1(1)+MTF_P_Img(2)×W1(2)+MTF_P_Img(3)×W1(3)+MTF_P_Img(4)×W1(4)  (19)P_AF=MTF_P_AF(1)×W2(1)+MTF_P_AF(2)×W2(2)+MTF_P_AF(3)×W2(3)+MTF_P_AF(4)×W2(4)  (20)

That is to say, the camera MPU 125 performs weighted addition on localmaximum value information of the defocus MTFs with respect to therespective spatial frequencies shown in FIG. 16C, using the evaluationbands W1 and W2 of the photographic image and the AF calculated in stepsS301 and S302 in the first embodiment. The in-focus position (P_img) ofthe photographic image and the in-focus position (P_AF) detected by theAF are thereby calculated.

Next, the camera MPU 125 calculates the BP correction value (BP) as inthe first embodiment, using Equation (21) below.BP=P_AF−P_img  (21)

On the other hand, if it is determined in step S505 that the evaluationband has been changed, the camera MPU 125 advances the processing tostep S506 and obtains evaluation band information. The evaluation bandinformation corresponds to the photographic image evaluation band W1 andthe AF evaluation band W2 in the first embodiment, and can be calculatedby following the idea described in FIGS. 11A to 11F, in accordance withthe settings and the situation of focus detection and the photographicimage. In step S506, after finishing obtaining the evaluation bandinformation, the camera MPU 125 advances the processing to step S507 andcalculates the BP correction value, as described above.

In the present embodiment, the processing relating to the position ofthe focus detection region, the color of an evaluation signal, and thecontrast direction is executed prior to the processing relating to theevaluation band. This is because, in the case where a photographerdetermines the position of the focus detection region by the settings,the information regarding the position of the focus detection region andthe evaluated colors and directions is not frequently changed. On theother hand, the signal evaluation band is frequently changed by thereadout mode of the image sensor, the digital filter for an AFevaluation signal, or the like, as described using FIGS. 11A to 11F inthe first embodiment. For example, in a low-illuminance environmentwhere the signal S/N ratio lowers, it is conceivable that the band ofthe digital filter is changed to a lower band. In the presentembodiment, in such a case, the BP correction value is calculated bycalculating a coefficient (peak coefficient) that is not frequentlychanged, thereafter storing the calculated coefficient, and calculatingonly a coefficient (evaluation band) that is frequently changed, asnecessary. The amount of calculation can thereby be reduced in the casewhere the photographer sets the position of the focus detection region,for example.

Modifications

On the other hand, the cases are also conceivable where BP correctionvalues corresponding to positions of a plurality of focus detectionregions are calculated. For example, the cases are conceivable where, atthe time of focus detection, focus detection using a plurality of focusdetection regions is performed, or where a plurality of defocus amountswithin an imaging area are to be obtained in order to create a defocusmap.

In this case, calculation relating to the color of an evaluation signal,the contrast direction, and the evaluation band is performed first, andthe calculation relating to the position of the focus detection regionis performed while changing only the focus detection region positioninformation, and the amount of calculation can thereby be reduced.

FIG. 17 is a flowchart showing another example of the BP correctionvalue calculation processing in step S400 in FIG. 14 . Processes ofperforming processing similar to that in FIG. 15 will be given the samereference numeral, and a redundant description thereof will be omitted.

In step S601, the camera MPU 125 determines whether or not alater-described BP coefficient has been changed. This determination isperformed in order to omit recalculation of the BP coefficient, in thecase where various conditions are identical in previously-performed BPcorrection value calculation and the current BP correction valuecalculation. In the present embodiment, if there has been no change inthe setting information (FIG. 16A) regarding the color and evaluationdirection for focus detection and the photographic image and theinformation (evaluation bands W1 and W2) regarding the evaluation band,the camera MPU 125 determines that the BP coefficient has not beenchanged, and skips the processing to step S605.

If, in step S501, the BP coefficient is calculated for the first time,or if it is determined that the BP coefficient has been changed, thecamera MPU 125 advances the processing to step S502, obtains the BPcorrection information as in the fourth embodiment, and advances theprocessing to step S603.

In step S603, the camera MPU 125 performs weighting relating to thecolor and the contrast direction of an evaluation signal on the peakinformation of six types of the defocus MTF, as described usingEquations (14) and (16). However, unlike in step S503, the positioninformation of the focus detection region is not substituted in Equation(14). Accordingly, MTF_P_RH (f, x, y), MTF_P_RV (f, x, y), MTF_P_GH (f,x, y), MTF_P_GV (f, x, y), MTF_P_BH(f, x, y), and MTF_P_BV (f, x, y) areobtained.

The camera MPU 125 then weights 12 coefficients (FIG. 16A) constitutingthe setting information obtained in step S500, using the above BPcorrection information. Specifically, the camera MPU 125 calculates aspatial frequency characteristic MTF_P_AF (f, x, y) for focus detectionand a spatial frequency characteristic MTF_P_IMG (f, x, y) for thephotographic image, using Equations (22) and (23).

$\begin{matrix}{{{MTF\_ P}{\_ AF}\left( {f,x,y} \right)} = {{{K\_ AF}{\_ RH} \times {MTF\_ P}{\_ RRH}\left( {f,x,y} \right)} + {{K\_ AF}{\_ RV} \times {MTF\_ P}{\_ RV}\left( {f,x,y} \right)} + {{K\_ AF}{\_ GH} \times {MTF\_ P}{\_ GH}\left( {f,x,y} \right)} + {{K\_ AF}{\_ GV} \times {MTF\_ P}{\_ GV}\left( {f,x,y} \right)} + {{K\_ AF}{\_ BH} \times {MTF\_ P}{\_ BH}\left( {f,x,y} \right)} + {{K\_ AF}{\_ BV} \times {MTF\_ P}{\_ BV}\left( {f,x,y} \right)}}} & (22) \\{{{MTF\_ P}{\_ IMG}\left( {f,x,y} \right)} = {{{K\_ IMG}{\_ RH} \times {MTF\_ P}{\_ RH}\left( {f,x,y} \right)} + {{K\_ IMG}{\_ RV} \times {MTF\_ P}{\_ RV}\left( {f,x,y} \right)} + {{K\_ IMG}{\_ GH} \times {MTF\_ P}{\_ GH}\left( {f,x,y} \right)} + {{K\_ IMG}{\_ GV} \times {MTF\_ P}{\_ GV}\left( {f,x,y} \right)} + {{K\_ IMG}{\_ BH} \times {MTF\_ P}{\_ BH}\left( {f,x,y} \right)} + {{K\_ IMG}{\_ BV} \times {MTF\_ P}{\_ BV}\left( {f,x,y} \right)}}} & (23)\end{matrix}$

Furthermore, the camera MPU 125 weights the evaluation band, using theevaluation bands W1 and W2 obtained in steps S301 and S302 in the firstembodiment, as with Equations (19) and (20). The in-focus position(P_img) of the photographic image and the in-focus position (P_AF)detected by the AF are thereby obtained as functions with the position(x, y) of the focus detection region as a variable, as expressed byEquations (24) and (25).

$\begin{matrix}{{{P\_ img}\left( {x,y} \right)} = {{{MTF\_ P}{\_ Img}\left( {{F\; 1},x,y} \right) \times W\; 1\mspace{14mu}(1)} + {{MTF\_ P}{\_ Img}\left( {{F\; 2},x,y} \right) \times W\; 1\mspace{14mu}(2)} + {{MTF\_ P}{\_ Img}\left( {{F\; 3},x,y} \right) \times W\; 1\mspace{14mu}(3)} + {{MTF\_ P}{\_ Img}\left( {{F\; 4},x,y} \right) \times W\; 1\mspace{14mu}(4)}}} & (24) \\{{{P\_ AF}\left( {x,y} \right)} = {{{MTF\_ P}{\_ AF}\left( {{F\; 1},x,y} \right) \times W\; 2\mspace{14mu}(1)} + {{MTF\_ P}{\_ AF}\left( {{F\; 2},x,y} \right) \times W\; 2\mspace{14mu}(2)} + {{MTF\_ P}{\_ AF}\left( {{F\; 3},x,y} \right) \times W\; 2\mspace{14mu}(3)} + {{MTF\_ P}{\_ AF}\left( {{F\; 4},x,y} \right) \times W\; 2\mspace{14mu}(4)}}} & (25)\end{matrix}$

In step S604, the camera MPU 125 stores coefficients constitutingEquations (24) and (25) as BP coefficients in the lens memory 118 or theRAM 125 b.

Next, in step S605, the camera MPU 125 determines whether or not theposition of the focus detection region has been changed, directlyadvances the processing to step S607 if there has been no change, and ifnot, the camera MPU 125 obtains the focus detection region positioninformation in step S606 and thereafter advances the processing to stepS607.

In step S607, the camera MPU 125 substitutes the position (x1, y1) ofthe focus detection region in which the BP correction value is to becalculated in Equations (24) and (25), and calculates the BP correctionvalue (BP) in accordance with Equation (26) below.BP=P_AF(x1,y1)−P_img(x1,y1)  (26)

With this configuration, it is possible to perform a reduction of theamount of calculation suitable for the case of calculating the BPcorrection value corresponding to positions of a plurality of focusdetection regions.

The content of the above calculation processing may be switched inaccordance with the situation. For example, the processing may beperformed as shown in FIG. 15 if one focus detection region is used infocus detection, and the processing may be performed as shown in FIG. 17if a plurality of focus detection regions are used.

With the above-described configuration, the BP correction value can becalculated while considering the spatial frequency of the color and thevertical/horizontal BP, and correction can be more accurately performed.

Fifth Embodiment

Next, a fifth embodiment of the present invention will be described. Thepresent embodiment is different from the fourth embodiment in the methodfor calculating the BP correction value. In the fourth embodiment, theBP correction value is calculated based on the premise that the range ofthe evaluation band of the BP correction information obtained from theimaging optical system is equal to the range of the AF evaluation bandand the photographic image evaluation band. However, it is conceivablethat, as the pixel pitch of the image sensor becomes finer, the range ofthe evaluation band is extended to the high frequency band side. It isalso conceivable that, with an increase in the accuracy of the imagingoptical system, the range of the evaluation band held as the BPcorrection information is extended to the high frequency band side.

In the present embodiment, in order to accurately calculate the BPcorrection value, limit band information is provided for each of theimage capture apparatus and the imaging optical system, and thecorrection value calculation processing is switched in accordance with arelationship regarding which is larger or smaller. By adjusting theevaluation band using the limit band information, the BP correctionvalue can be accurately calculated regardless of the combination of theimage capture apparatus and the imaging optical system that are new orold.

Note that the block diagram (FIG. 2 ) of the image capture apparatus,the diagrams (FIGS. 3A to 5 ) illustrating the focus detection methods,the diagram (FIG. 6 ) illustrating the focus detection region, thediagrams (FIGS. 11A to 11F) illustrating the evaluated frequency bands,and the focus detection processing (FIG. 14 ) are common in the presentembodiment, and accordingly will also be used in the followingdescription.

A method for calculating the BP correction values (BP) in the presentembodiment will now be described using FIGS. 18 and 19A to 19C.

In FIG. 18 , steps in which processing similar to the focus detectionprocessing in the fourth embodiment is performed are given the samereference numerals as those in FIG. 15 . The present embodiment isdifferent in that the processing includes a step of limit bandprocessing (S700) before the BP correction value calculation processing(S507). In the limit band processing, a relationship is determinedregarding which of a limit value (camera limit band) on the highfrequency side of the evaluation band of the image capture apparatus anda limit value (lens limit band) on the high frequency side of theevaluation band of the imaging optical system is larger or smaller.Discretization processing for MTF_P_AFF and MTF_P_IMGF expressed byEquations (15) and (16) is switched in accordance with the relationshipregarding which is larger or smaller.

The details of the limit band processing performed in step S700 in FIG.18 will be described below using FIG. 19A.

In step S701, the camera MPU 125 obtains the limit band information.Here, the camera MPU 125 obtains camera limit band information from theROM 125 a, and obtains the lens limit band information from the lensmemory 118. The camera limit band is set based on a Nyquist frequency,which is determined mainly by the pixel pitch of the image sensor. Onthe other hand, as the lens limit band, a limit value of the band withwhich the response of the MTF of the imaging optical system is largerthan or equal to a threshold value, a limit value of the band in whichmeasurement data is reliable, or the like is set.

Next, in step S702, the camera MPU 125 compares the camera limit bandwith the lens limit band in terms of which is larger or smaller. If thecamera limit band is larger (i.e., has a higher limit frequency) thanthe lens limit band, the camera MPU 125 advances the processing to stepS703, and if the camera limit band is smaller than or equal to the lenslimit band, the camera MPU 125 ends the limit band processing.

In step S703, the camera MPU 125 manipulates the peak coefficient. Anexample of manipulation of the peak coefficient will be described usingFIG. 19B. FIG. 19B shows MTF_P_AFF and MTF_P_IMGF that are shown in FIG.16C in the fourth embodiment. It is assumed here that the lens limitband and the camera limit band are F4 and F6, respectively. Nq is theNyquist frequency determined by the pixel pitch of the image sensor 122,and the camera limit band is set lower than Nq.

MTF_P_AFF is calculated from the BP correction information, andinformation of the position of the focus detection region and the colorand the evaluation direction of an evaluation signal. FIG. 19B shows, onthe vertical axis, the focusing lens positions (peak positions) LP4_AF,LP5_AF, LP6_AF, and LP7_AF at which the defocus MTFs obtained bysubstituting discrete spatial frequencies F1 to F4 in Equation (17)reach their peaks (local maximum values).

Since the lens limit band is F4, the accuracy of the peak positioncalculated by Equation (17) with respect to a spatial frequency higherthan F4 is not guaranteed. For this reason, in the present embodiment,the peak positions LP8_AF and LP9_AF corresponding respectively tospatial frequencies F5 and F6 are calculated from the information of thepeak positions corresponding to the spatial frequency F4 and lowerspatial frequencies. It is conceivable, as shown in FIG. 19B, the peakvalue LP7_AF with respect to the spatial frequency F4 is simply used asthe peak positions LP8_AF and LP9_AF corresponding to the spatialfrequencies F5 and F6. In the case of more accurate calculation, thepeak positions LP8_AF and LP9_AF may be obtained by extrapolationcalculation using information of a plurality of peak positions (LP4_AF,LP5_AF, LP6_AF, LP7_AF) corresponding to the spatial frequency F4 andlower spatial frequencies.

Regarding MTF_P_IMGF as well, peak positions LP8_Img and LP9_Imgcorresponding to the spatial frequencies F5 and F6 are calculated byperforming similar processing. FIG. 19B shows an example of using thepeak value LP7_Img with respect to the spatial frequency F4 also as thepeak positions LP8_Img and LP9_Img corresponding to the spatialfrequencies F5 and F6.

In step S703, the camera MPU 125 stores, as the peak coefficients,LP4_AF to LP7_AF, LP8_AF, and LP9_AF as MTF_P_AF(n) (1≤n≤6) in the lensmemory 118 or the RAM 125 b. Similarly, the camera MPU 125 storesLP4_Img to LP7_Img, LP8_Img, and LP9_Img as MTF_P_Img(n) (1≤n≤6) in thelens memory 118 or the RAM 125 b, and ends the limit band processing.

The camera MPU 125 also calculates the BP correction value as withEquations (19) to (21), using the information of the spatial frequencyF6, which is the camera limit band, and lower spatial frequencies as theAF evaluation band and the photographic image evaluation band.

As described above, if, in step S702, the camera limit band is smallerthan or equal to the lens limit band, the limit band processing isterminated without performing the processing for manipulating the peakcoefficient in step S703. A reason why the processing for manipulatingthe peak coefficient may be omitted will now be described using FIG.19C. FIG. 19C shows an example of MTF_P_AFF and MTF_P_IMGF in the casewhere the camera limit band is smaller than or equal to the lens limitband, with respect to a band similar to that in FIG. 19B. It is assumedhere that the camera limit band and the lens limit band are F4 and F6,respectively. As mentioned above, the camera limit band is set lowerthan the Nyquist frequency Nq.

In the case of omitting processing for manipulating the peakcoefficient, information of the peak position relating to the imagingoptical system excessively exists with respect to the evaluation area,since the camera limit band is smaller than or equal to the lens limitband. On the other hand, the AF evaluation band and the photographicimage evaluation band described using FIGS. 11A to 11F are calculated ina band smaller than or equal to the camera limit band. In the presentembodiment, if the camera limit band is smaller than or equal to thelens limit band, the BP correction value is calculated without usinginformation of the peak position corresponding to a spatial frequencyhigher than the camera limit band. Since the camera limit band is setlower than the Nyquist frequency Nq determined by the pixel pitch of theimage sensor, the information regarding a band larger than or equal tothe camera limit band is lost in sampling by the pixels. For thisreason, the accuracy of the BP correction value calculation ismaintained even if the above processing is performed.

Although the present embodiment has described the case of using theinformation of the peak positions (focusing lens position at which thedefocus MTFs reach their peaks) based on the fourth embodiment, theinformation of an aberration of the imaging optical system is notlimited thereto. For example, a defocus MTF shape that is out of ahandleable range may be calculated using the defocus MTF informationdescribed in the first embodiment.

As described above, in the present embodiment, if the camera limit bandis higher than the lens limit band, the number of discrete frequenciesindicating the spatial frequency characteristics for the autofocus andfor the photographic image is increased in accordance with the cameralimit band. For this reason, the BP correction value can be accuratelycalculated regardless of the combination of the image capture apparatusand the imaging optical system.

Other Embodiments

Embodiments of the present invention can also be realized by a computerof a system or apparatus that reads out and executes computer executableinstructions (e.g., one or more programs) recorded on a storage medium(which may also be referred to more fully as a ‘non-transitorycomputer-readable storage medium’) to perform the functions of one ormore of the above-described embodiments and/or that includes one or morecircuits (e.g., application specific integrated circuit (ASIC)) forperforming the functions of one or more of the above-describedembodiments, and by a method performed by the computer of the system orapparatus by, for example, reading out and executing the computerexecutable instructions from the storage medium to perform the functionsof one or more of the above-described embodiments and/or controlling theone or more circuits to perform the functions of one or more of theabove-described embodiments. The computer may comprise one or moreprocessors (e.g., central processing unit (CPU), micro processing unit(MPU)) and may include a network of separate computers or separateprocessors to read out and execute the computer executable instructions.The computer executable instructions may be provided to the computer,for example, from a network or the storage medium. The storage mediummay include, for example, one or more of a hard disk, a random-accessmemory (RAM), a read only memory (ROM), a storage of distributedcomputing systems, an optical disk (such as a compact disc (CD), digitalversatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, amemory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Applications Nos.2014-094877, filed May 1, 2014, and 2014-169803, filed Aug. 22, 2014,which are hereby incorporated by reference herein in their entirety.

What is claimed is:
 1. An imaging optical system attachable to anddetachable from an imaging apparatus, comprising: a lens MPU; and astorage device that stores information on aberrations of the imagingoptical system, wherein the information is to be used for automaticfocusing adjustment performed by an imaging apparatus to which theimaging optical system is attached, wherein the lens MPU transmits theinformation from the storage device to the imaging apparatus, whereinthe information includes (i) information of image-forming positions ofthe imaging optical system for each of a plurality of spatialfrequencies and (ii) information of a specific spatial frequency out ofthe plurality of spatial frequencies, wherein the (i) information ofimage-forming positions of the imaging optical system for each of aplurality of spatial frequencies is stored in advance in the storagedevice as coefficients of a function for calculating a correction valueto correct an in-focus position of the imaging optical system caused bythe aberrations of the imaging optical system, the function having aspatial frequency (f) and a position (x, y) of focus detection area onan image sensor of the imaging apparatus as variables, wherein the (ii)information of a specific spatial frequency out of the plurality ofspatial frequencies is defined as a maximum spatial frequency to beapplied to the function, and wherein the application of the maximumspatial frequency to the function is performed based on a relationshipbetween the maximum spatial frequency and a limit value on a highfrequency side of an evaluation band of the imaging apparatus.
 2. Theimaging optical system according to claim 1, wherein each of theimage-forming positions corresponding to one of a plurality ofmodulation transfer function (MTF) curves for the plurality of spatialfrequencies.
 3. The imaging optical system according to claim 1, whereinthe information transmitted to the imaging apparatus further includesinformation corresponds to positions of a focus lens of the imagingoptical system.
 4. The imaging optical system according to claim 1,wherein the information transmitted to the imaging apparatus furtherincludes information corresponds to zoom positions of the imagingoptical system.
 5. The imaging optical system according to claim 1,wherein the information is transmitted to the imaging apparatus when theimage optical system is attached to the imaging apparatus.
 6. Theimaging optical system according to claim 1, wherein the information istransmitted to the imaging apparatus each time focus detectionprocessing is performed by the imaging apparatus.
 7. The imaging opticalsystem according to claim 1, wherein the information is to correct afocus detection result obtained by the imaging apparatus.
 8. The imagingoptical system according to claim 1, further comprising: a zoom lens forchanging a focal length of the imaging optical system; and a diaphragmfor adjusting an amount of light.
 9. The imaging optical systemaccording to claim 1, the lens MPU transmits the information to theimaging apparatus responsive to a request from the imaging apparatus.10. The imaging optical system according to claim 1, wherein the lensMPU is connected to the imaging apparatus via a signal line provided ina lens mount and transmits the information to the imaging apparatusresponsive to the request from the imaging apparatus.
 11. The imagingoptical system according to claim 1, wherein a limit band processing isperformed in a case that the limit value is higher than the maximumspatial frequency.
 12. The imaging optical system according to claim 1,wherein the limit value is determined based on a Nyquist frequency,which is determined by the pixel pitch of an image sensor.
 13. A controlmethod of an imaging optical system that is attachable to and detachablefrom an imaging apparatus and comprises a storage device storinginformation on aberrations of the imaging optical system, the controlmethod comprising: transmitting, by a lens MPU, the information storedin the storage device to an imaging apparatus to which the imagingoptical system is attached, wherein the information is to be used forautomatic focusing adjustment performed by the imaging optical system,wherein the information includes (i) information of image-formingpositions of the imaging optical system for each of a plurality ofspatial frequencies and (ii) information of a specific spatial frequencyout of the plurality of spatial frequencies, wherein the (i) informationof image-forming positions of the imaging optical system for each of aplurality of spatial frequencies is stored in advance in the storagedevice as coefficients of a function for calculating a correction valueto correct an in-focus position of the imaging optical system caused bythe aberrations of the imaging optical system, the function having aspatial frequency (f) and a position (x, y) of focus detection area onan image sensor of the imaging apparatus as variables, wherein the (ii)information of a specific spatial frequency out of the plurality ofspatial frequencies is defined as a maximum spatial frequency to beapplied to the function, and wherein the application of the maximumspatial frequency to the function is performed based on a relationshipbetween the maximum spatial frequency and a limit value on a highfrequency side of an evaluation band of the imaging apparatus.
 14. Animaging apparatus comprising: an image sensor configured to capture anobject image, formed by an imaging optical system having a focus lens,and to output an image signal; one or more processors; and memorystoring instructions that, when executed by the one or more processors,cause the imaging apparatus to perform operations including: outputtinga focus detection result based on the image signal output from the imagesensor for a focusing operation, acquiring, from the imaging opticalsystem, (i) information of image-forming positions of the imagingoptical system for each of a plurality of spatial frequencies and (ii)information of a specific spatial frequency out of the plurality ofspatial frequencies, wherein the (i) information of image-formingpositions of the imaging optical system for each of a plurality ofspatial frequencies is stored in advance in the imaging optical systemas coefficients of a function having a spatial frequency (f) and aposition (x, y) of focus detection area on an image sensor of theimaging apparatus as variables, wherein the (ii) information of aspecific spatial frequency out of the plurality of spatial frequenciesis defined as a maximum spatial frequency to be applied to the function,and wherein the application of the maximum spatial frequency to thefunction is performed based on a relationship between the maximumspatial frequency and a limit value on a high frequency side of anevaluation band of the imaging apparatus; calculating a correction valueusing the function based on the information acquired from the imagingoptical system, correcting the focus detection result by using thecorrection value, and adjusting a position of the focus lens based onthe corrected focus detection result.
 15. A control method of an imagingapparatus that comprises an image sensor configured to capture an objectimage, formed by an imaging optical system having a focus lens, and tooutput an image signal, the control method comprising: outputting afocus detection result based on the image signal output from the imagesensor for a focusing operation, acquiring, from the imaging opticalsystem, (i) information of image-forming positions of the imagingoptical system for each of a plurality of spatial frequencies and (ii)information of a specific spatial frequency out of the plurality ofspatial frequencies, wherein the (i) information of image-formingpositions of the imaging optical system for each of a plurality ofspatial frequencies is stored in advance in the imaging optical systemas coefficients of a function having a spatial frequency (f) and aposition (x, y) of focus detection area on an image sensor of theimaging apparatus as variables, wherein the (ii) information of aspecific spatial frequency out of the plurality of spatial frequenciesis defined as a maximum spatial frequency to be applied to the function,and wherein the application of the maximum spatial frequency to thefunction is performed based on a relationship between the maximumspatial frequency and a limit value on a high frequency side of anevaluation band of the imaging apparatus; calculating a correction valueusing the function based on the information acquired from the imagingoptical system, correcting the focus detection result by using thecorrection value, and adjusting a position of the focus lens based onthe corrected focus detection result.
 16. A non-transitory storagemedium storing a program that causes, when executed by one or moreprocessors of an imaging apparatus that comprises an image sensorconfigured to capture an object image, formed by an imaging opticalsystem having a focus lens, and to output an image signal, the one ormore processors to perform a control method comprising: outputting afocus detection result based on the image signal output from the imagesensor for a focusing operation, acquiring, from the imaging opticalsystem, (i) information of image-forming positions of the imagingoptical system for each of a plurality of spatial frequencies and (ii)information of a specific spatial frequency out of the plurality ofspatial frequencies, wherein the (i) information of image-formingpositions of the imaging optical system for each of a plurality ofspatial frequencies is stored in advance in the imaging optical systemas coefficients of a function having a spatial frequency (f) and aposition (x, y) of focus detection area on an image sensor of theimaging apparatus as variables, wherein the (ii) information of aspecific spatial frequency out of the plurality of spatial frequenciesis defined as a maximum spatial frequency to be applied to the function,and wherein the application of the maximum spatial frequency to thefunction is performed based on a relationship between the maximumspatial frequency and a limit value on a high frequency side of anevaluation band of the imaging apparatus, calculating a correction valueusing the function based on the information acquired from the imagingoptical system, correcting the focus detection result by using thecorrection value, and adjusting a position of the focus lens based onthe corrected focus detection result.